Answers for "value clear in jquery"

2

jquery clear form values

$(".reset").click(function() {
    $(this).closest('form').find("input[type=text], textarea").val("");
});
Posted by: Guest on April-03-2020
0

clear value input jquery

<body>
    <form method="" action="">
        <input type="text" name="email" class="input" />
        <input type="submit" value="Sign Up" class="button" />
    </form>
</body>

<script>
    $(document).ready(function() {
        $(".input").val("Email Address");
        $(".input").on("focus", function() {
            $(".input").val("");
        });
        $(".button").on("click", function(event) {
            $(".input").val("");
        });
    });
</script>
Posted by: Guest on July-11-2020

Code answers related to "value clear in jquery"

Code answers related to "Javascript"

Browse Popular Code Answers by Language