Good morning, I'm just starting with javascript and it's costing me a little ... What I want to do is that when I click on the button it changes its value, but I do not understand the error:
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<title>Hola mundo</title>
<script src="holamundo_ext.js"></script>
</head>
<body>
<input type="button" value="Hola" id="boton" onclick="cambiarboton()">
</body>
</html>
function cambiarboton(){
var i=document.getElementById("boton").innerHTML("Mundo");
}
window.onload=cambiarboton();
On the console it says:
TypeError: document.getElementById (...) is null TypeError: document.getElementById (...). InnerHTML is not a function
Thank you in advance!