input value in console javascript code example
Example 1: javascript console input
//SpiderMonkey
var input = readline();
//Vanilla javascript
var input = prompt("Enter input:");
Example 2: js console log input value
<input type="text" placeholder="name" id="uname" />
<input type="button"value="submit" onclick="send()" />
let uname = document.querySelector("#uname");
function send() {
console.log(uname.value);
}