javascript – Doubt for an activity

Question:

3) Write a Javascript code that changes the value of the text element's content to “Pedro Brigatto”.

I have to change the value of this value in this input:

<!DOCTYPE html>
<html>
  <body>
    <input type="text" id="myText" value="Mudar aqui">
  </body>
</html>

Answer:

The code could be this:

document.getElementById("myText").value = "Pedro Brigatto";
document.getElementById("myText").value = "Pedro Brigatto";
<input type="text" id="myText" value="Mudar aqui">
Scroll to Top