Ademas se elaboro en clase el siguiente Ejercicio:
<html> | |
<head> | |
<title>ejercicio</title> | |
</head> | |
<script type="text/javascript"> | |
//----------------------------------------------------------------- | |
function nameA(){ | |
document.getElementById("rta").value = document.getElementById("uno").value | |
} | |
//----------------------------------------------------------------- | |
function nameB(){ | |
document.getElementById("rta").value = document.getElementById("dos").value | |
} | |
//----------------------------------------------------------------- | |
function nameC(){ | |
document.getElementById("rta").value = document.getElementById("tres").value | |
} | |
//----------------------------------------------------------------- | |
function nameD(){ | |
document.getElementById("rta").value = document.getElementById("uno").value + " " +document.getElementById("dos").value+ " " + document.getElementById("tres").value+ " " + document.getElementById("cuatro").value | |
} | |
//----------------------------------------------------------------- | |
</script> | |
<body> | |
Uno: <input type="text" id="uno"> <input type="button" value="uno" onclick="nameA()"><br> | |
Dos: <input type="text" id="dos"> <input type="button" value="dos" onclick="nameB()"><br> | |
Tres: <input type="text" id="tres"> <input type="button" value="tres" onclick="nameC()"><br> | |
Cuatro: <input type="text" id="cuatro"> <input type="button" value="cuatro" onclick="nameD()"><br> | |
Resultado: <input type="text" id="rta"> | |
</body> | |
</html> |
No hay comentarios.:
Publicar un comentario