miércoles, 23 de noviembre de 2016

Variables

<html>

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

<body>
<input type="text" id="textInput">
<button id="textChanger">Change the text!</button>
<p id="text">This is some text</p>
<script type="text/javascript">
document.getElementById("textChanger").onclick = function() {
var textEntered = "";
textEntered = document.getElementById("textInput").value;
document.getElementById("text").innerHTML = textEntered;
}
</script>
</body>

</html>

No hay comentarios:

Publicar un comentario