उदाहरण
value प्रॉपर्टी का उपयोग करके इनपुट फील्ड की वैल्यू प्राप्त करें।
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<input type="text" id="getValues" value="My Name is John Smith" />
<script>
var originalvalue = document.getElementById("getValues").value;
console.log("The value in the text box is =" + originalvalue);
</script>
</body>
</html>
फ़ाइल सेव करें और Live Server से खोलें।
आउटपुट
कंसोल में इनपुट फील्ड की वैल्यू दिखाई देगी।