Javascript examples for jQuery Method and Property:val
Jquery .val() changes the value in dom
<html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> <title>Demo by roXon</title> </head> //from w w w .ja v a 2 s .c o m <body> <input type"text" id="my" value="world"> <script> $(function(){ $("#my").val("hello"); console.log($("#my").val()); }); </script> </body> </html>