-1
I have the following code below, where I want to store the value of the variable contained in document.getElementById, which comes from input, and which should be "text".
This line of programming only prints the initial input value on the screen, but does not store it. I tried to associate to var note, and gave a print command to see if it really was registered, it should appear written the value of the input twice, but only appears once. I wish to use 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???
}
Where is the Java variable mentioned in the title?
– Augusto Vasques