Javascript examples for jQuery:Form Text Input
get input text value with jquery
<html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> </head> /*www . j a v a2 s . c o m*/ <body> <div id="content"> <input type="text" id="textfield"> <button type="button" id="btn" onclick="go()">Go</button> </div> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script type="text/javascript"> function go() { console.log($("#textfield").val()); } </script> </body> </html>