<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); }