0
How do you access the result of a text box in HTML?
Been working on HTML lately and realized that in one of my projects I need a way to access what the user puts in the textbox, so how do you do that? In case you need to know, I created the textbox using <input type = text>
4 Answers
+ 7
you need javascript for that!
+ 6
function init {
let text = document.getElementsByTagName("input")[0].value;
alert (text);
}
window.onload = init;
+ 1
Yeah I know but I can't think of how to in JavaScript either. Been learning that for months
+ 1
Ah I forgot about the .value method. Thank you!