pTutorial

New way to learn Programming

JQuery form field value

JQuery : HTML Form - input value

In this article I showed you on how to get the instant value of form fiel using JQuery. You can use following script to get the instant result.

JQuery input field value example

<!doctype html>
<html lang="en">
<head>
<style>
p{
color: red;
size:15px;
}
</style>
<script src="http://freeonlinecompiler.ptutorial.com/
js/jquery.min.js"></script>
</head>
<body>
<h2> Please Type something to see the result </h2>
<input type="text" value="">
<p></p>

<script>
$( "input" ).keyup(function() {
var value = $( this ).val();
$( "p" ).text( value );
});
</script>

</body>
</html>

Download

See Also


QUOTES OF THE DAY

Crafty men condemn studies, simple men admire them, and wise use them.

LIKE ON FACEBOOK

+1 ON GOOGLE

SHARE ON TWITTER