hello everyone would like to know how to take the text you have on a label to later use it in uan avariable hi
apparently with value does not work with .value or .innerHTMl I hope someone helps me with this. greetings
hello everyone would like to know how to take the text you have on a label to later use it in uan avariable hi
apparently with value does not work with .value or .innerHTMl I hope someone helps me with this. greetings
I'll give you the example so you can see it
var a = document.getElementById('saludos');
document.write("<br><br>");
document.write("Texto impreso con innerHTML (se imprime e interpreta la etiqueta span):");
document.write("<br>");
document.write(a.innerHTML);
document.write("<br><br>");
document.write("Texto impreso con textContent (sólo se recoge el texto):");
document.write("<br>");
document.write(a.textContent);
span {background-color: #AAA;}
<div id="saludos">
Buenos días, <span>buenas tardes</span> y buenas noches.
</div>