Suppose there is an html page, there is an input element on it, js file is connected to the html page, in which I want to get the text entered in the input, how can this be done? In short: the algorithm of interaction between html and javascript?
1 answer
Algorithm:
- Find javascript on the page necessary
input
UPD ( from @Grundy comments )
What to look for:
- Read its meaning
Example:
var input = document.getElementById("input"), output = document.getElementById("out"); input.addEventListener("keyup", function() { out.innerText = input.value; }, false); <input id="input" /> <div id="out"></div> - oneWhat to search: getElementById , getElementsByClassName , getElementsByTagName , getElementsByName , querySelector , querySelectorAll - Grundy
- @Grundy thanks - added in reply - Zoltan Toth
|
DOM в javascript. - MaximPro