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>

6th Nov 2017, 9:22 PM
jacksonofgames 28
jacksonofgames 28 - avatar
4 Respuestas
+ 7
you need javascript for that!
6th Nov 2017, 9:23 PM
Kamil
Kamil - avatar
+ 6
function init { let text = document.getElementsByTagName("input")[0].value; alert (text); } window.onload = init;
6th Nov 2017, 9:32 PM
Kamil
Kamil - avatar
+ 1
Yeah I know but I can't think of how to in JavaScript either. Been learning that for months
6th Nov 2017, 9:26 PM
jacksonofgames 28
jacksonofgames 28 - avatar
+ 1
Ah I forgot about the .value method. Thank you!
6th Nov 2017, 9:33 PM
jacksonofgames 28
jacksonofgames 28 - avatar