Populate input field using jQuery - Javascript jQuery

Javascript examples for jQuery:Form Input

Description

Populate input field using jQuery

Demo Code

ResultView the demo in separate window

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

Related Tutorials