Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

empty the value of an input in jquery

$('#field').val('');
Comment

all input value empty jquery

// Behold the power of JQuery.
$('#myform')[0].reset();
Comment

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>
Comment

jquery select input with empty value

$('input:text').filter(function() { return $(this).val() == ""; });
Comment

PREVIOUS NEXT
Code Example
Javascript :: use jetbrains mono in vscode 
Javascript :: first non repeating character javascript 
Javascript :: query params in next js 
Javascript :: how to update version of dependencies reactjs 
Javascript :: javascript clear form after dubmit 
Javascript :: maximum product of word 
Javascript :: how to access variables from render() to outside of render() in class react component 
Javascript :: javascript go to url 
Javascript :: add comma to number in javascript 
Javascript :: i18n turn off suspense react 
Javascript :: javascript get random item from array 
Javascript :: clean way to Deal with undefined in chrome storage local get 
Javascript :: Function in JavaScript that can be called only once 
Javascript :: regular expression number from 1 to 100 
Javascript :: loopback model properties 
Javascript :: At line:1 char:1 + nodemon server.js 
Javascript :: how to remove element from array react native 
Javascript :: es6 foreach 
Javascript :: checking if a character is an alphabet in js 
Javascript :: react map 
Javascript :: read json file javascript 
Javascript :: js extract options from select 
Javascript :: jquery sum all input values 
Javascript :: fetch url in javascript 
Javascript :: javascript intellisense not working in vs code 
Javascript :: or in js 
Javascript :: React Native - navigation is undefined 
Javascript :: character to ascii in js 
Javascript :: search by date interval mongoose 
Javascript :: get platform node 
ADD CONTENT
Topic
Content
Source link
Name
3+7 =