For you to select an HTML element in Javascript, seven your field with an ID, if use once, as was done in your code:
<input type="text" id="myText" value="Mudar aqui">
In this case, your ID is "myText".
In Javascript, you need to take this data and set it, just like @Dvd did in the previous answer, but who does it for you is the:
document.getElementById("AQUI VAI O SEU ID");
When you put the .value after this code, you are picking up the value of your input field. You can pick up other parameters, as I will give some examples below:
Change the class parameter:
document.getElementById("myText").class = "Pedro Brigatto";
Change the id parameter:
document.getElementById("myText").id = "Pedro Brigatto";
I hope I’ve contributed to your knowledge! :)
What doubt do you have?
– Sergio