Javascript examples for jQuery:Form Input
Populate input field using jQuery
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> <script type="text/javascript"> $(window).load(function(){/*from w w w . j a v a 2 s . co m*/ $('.hiddenfield').val( $('.prodheader').html() ); }); </script> </head> <body> <span class="prodheader">Apply now</span> <input type="text" class="hiddenfield" value=""> </body> </html>