jQuery val Method
home
Run
screen_rotation
fullscreen
cloud_download
navigate_before
<!DOCTYPE html> <html> <head> <title>jQuery Demo example</title> <script type="text/javascript" src="http://code.jquery.com/jquery-2.1.4.min.js"> </script> <script type="text/javascript"> $(document).ready(function(){ $( "#valExample" ).on( "click", function(event) { $("#fname").val("John Doe"); }); }); </script> <style> div{ margin:10px; height:300px; width:300px; border:2px solid red; float:left; } </style> </head> <body> <h4 ><a href="javascript:void(0);" id="valExample">Click to run .val() Example </a></h4> <form > <input type="text" name="fname" id="fname"> </form> </body> </html>
<!DOCTYPE html> <html> <head> <title>jQuery Demo example</title> <script type="text/javascript" src="http://code.jquery.com/jquery-2.1.4.min.js"> </script> <script type="text/javascript"> $(document).ready(function(){ $( "#valExample" ).on( "click", function(event) { $("#fname").val("John Doe"); }); }); </script> <style> div{ margin:10px; height:300px; width:300px; border:2px solid red; float:left; } </style> </head> <body> <h4 ><a href="javascript:void(0);" id="valExample">Click to run .val() Example </a></h4> <form > <input type="text" name="fname" id="fname"> </form> </body> </html>
Copyrights@tutorialsplane.com