Javascript examples for jQuery:Form Input
Change the value of the input field to "new value".
<!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script> $(document).ready(function(){ $("input").val("new value"); });/*w ww. j a v a 2 s . c om*/ </script> </head> <body> Name: <input type="text" value="old value"> </body> </html>