Javascript element.value method
<html>
<head>
<title>get a user input in js</title>
</head>
<body>
<h1>get a user input in js</h1>
<input type="" id="in" placeholder="Enter here" /><br><br>
<button onclick="getInput()">Get value</button>
<scriprt>
function getInput() {
var x = document.getElementById('in');
alert(x.value);
}
</scriprt>
</body>
</html>