miércoles, 23 de noviembre de 2016

Responder a un click

<html>

<head>
<title>Javascript</title>
</head>

<body>
<p id="text">Hello World!</p>
<button id="myButton">Change text</button>
<script type="text/javascript">
document.getElementById("myButton").onclick = function() {
document.getElementById("text").innerHTML = "Hello Rob!";
}
</script>
</body>

</html>

No hay comentarios:

Publicar un comentario