Get the value of the input field. - Javascript jQuery

Javascript examples for jQuery:Form Input

Description

Get the value of the input field.

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
    console.log($("input").val());
});//from   w ww  . j  a va  2  s  . co m
</script>
</head>
<body>

Name: <input type="text" value="old value">

</body>
</html>

Related Tutorials