I need to make the data (in this case, 4 digits) from the textarea be taken as var and so that they can be compared with other variables using if ... else and output as alert ();

    1 answer 1

    html:

    <textarea id="text"></textarea> 

    js:

     var el; var text; el = document.getElementById("text"); text = el.value; //тут можно делать что хочется с text document.onclick = function(){ allert(text); }