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?

  • one
    Curry DOM в javascript . - MaximPro

1 answer 1

Algorithm:

  1. Find javascript on the page necessary input

UPD ( from @Grundy comments )

What to look for:


  1. 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>