<head>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
</head>
<body>
<input type="text" id="nameInput" placeholder="Enter your name">
<button id="setValBtn">Set Name</button>
<script>
$(document).ready(function() {
$("#setValBtn").click(function() {
$("#nameInput").val("John Doe");
});
});
</script>
</body>
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.