JavaScript Получить значение ввода текста
var inputValue = document.getElementById("myTextInputID").value;
Grepper
var inputValue = document.getElementById("myTextInputID").value;
document.getElementById("YourTextBoxId").value
//This code will get the input from a textbox
//Make sure to change "YourTextBoxId" with the id of your textbox
// to get value from text input (or textarea):
// in html:
<input class="my-class">type something here with console opened</input>
// in js:
const myInputArea = document.querySelector(".my-class")
myInputArea.addEventListener("input", (e)=>{
const myInputText = e.target.value
console.log(myInputText)
})
var input = window.prompt("");