Access form items through function - Javascript jQuery

Javascript examples for jQuery:Form Input

Description

Access form items through function

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://code.jquery.com/jquery-1.8.3.js"></script> 
  <script type="text/javascript">
    $(window).load(function(){/*from   w  ww .j av a 2s .com*/
console.log(getelementval("#frm"));
function getelementval(frm) {
    return $(frm)[0].textbox.value;
}
    });

      </script> 
 </head> 
 <body> 
  <form id="frm"> 
   <input type="text" id="textbox" name="textbox" value="some value"> 
  </form>  
 </body>
</html>

Related Tutorials