I have the following code, where I want to store the value of the variable contained in document.getElementById
, which comes from the input, and which should be "text".
This line of programming only prints the value of the initial input on the screen but does not store it. I tried to associate it with the var note, and I gave a print command to see if it really was registered, it should be written the input value twice, but only appears once. I wish to use it was new variable, for another purpose. What would be wrong?
<input id="text">
......
........
<script>
var speaker = new RobotSpeaker();
function talk() {
speaker.speak("pt", document.getElementById("text").value);///esta linha imprime o texto FALADO, na tela
var nota = document.getElementById("text").value); //salvaria em nota o valor de text??
console.log(nota.value); // Recuperando o valor:
window.document.write("nota");///imprime na tela de novo???
}