Change the value of the input field to "new value". - Javascript jQuery

Javascript examples for jQuery:Form Input

Description

Change the value of the input field to "new value".

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(){
    $("input").val("new value");
});/*w ww. j  a v  a  2  s .  c  om*/
</script>
</head>
<body>

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

</body>
</html>

Related Tutorials