Html

Páginas: 6 (1415 palabras) Publicado: 30 de abril de 2012
Formulario
<html>
</html lang="es">
<head>
<title> ejemplo</title>
</head>
<body>
<p>clase3</p>
<form name="formulario" action="PAGINA DOS.html" method="post">
<p>nombre: <input type="text" name="txt_nombre"/></p>
<p>apellido: <input type="text" name="txt_apellido"/></p><p>clave: <input type="password" name="txt_clave"/></p>
<p>hombre: <input type="radio" name="r_hombre" values="hombre"/></p>
<p>mujer: <input type="radio" name="r_mujer" values="mujer"/></p>
<p>alumno: <input type="checkbox" name="chk_alumno" values="si"/></p>
<p><input type="submit" values="enviar"/></p></form>
</body>
</html>
……………………………………………………………………………………………………………………………………………………………………………………………………………………
Cambiar color
<head>
<title>Ejemplo</title>
</head>
<body>
<p id= "texto">ejemplo1</p>
<script>
document.body.bgColor='lavender';
</script>
</body>
</html>
Eventos sobre unbotón:
<html lang="es">
<head>
<title>Ejemplo</title>
</head>
<body>
<p id= "texto1">ejemplo1</p>
<input type="button" value="cambiar color fondo" onclick="document.body.bgColor='red'"/>
<input type="button" value="cambiar color fondo" onclick="document.body.bgColor='white'"/>
</body>
</html>……………………………………………………………………………………………………………………………………………………………………………………………………………
Function alerta:
<head>
<title>Ejemplo</title>
</head>
<body>
<script>
function alerta (){
alert("este es un mensaje de alerta!");
}
</script>
<input type="button" value="mensaje de alerta!" onclick="alerta();"/>
</body>
</html>………………………………………………………………………………………………………………………………………………………………………………………………….
Mostrar las cajas:
<html>
<head>
<script>
function mostrar(){
var texto1 = document.getElementById("txt_1").value;
var texto2 = document.getElementById("txt_2").value;
alert(texto1 + "\n" + texto2); }
</script>
</head>
<body>
<input type="text" id="txt_1" />
<input type="text" id="txt_2" />
<inputtype="button" onclick="mostrar();" id="btn_1" value="mostrar cajas"/>
</body>
</html>
………………………………………………………………………………………………………………………………………………………………………………………..
Variables:
<html lang="es">
<head>
<title>Ejemplo</title>
</head>
<body>
<p id="texto">ejemplo</p>
<script>
//alert("texto con java script");txt=document.getElementById("texto").innerHTML;
document.write("</br>MI VARIABLE TEXTO: " +txt);
document.write("</br>MI VARIABLE TEXTO: " +txt);
document.write("</br>MI VARIABLE TEXTO: " +txt);
</script>
</body>
</html>

Sumar:
<html lang="es">
<head>
<title>Ejemplo</title>
</head>
<body><script>
function suma(){
a = document.getElementById("txt_1").value;
b = document.getElementById("txt_2").value;
suma = parseInt(a) + parseInt(b);
alert(suma); }
</script>
<input type="text" value="" id="txt_1"/>
<input type="text" value="" id="txt_2"/>
<input type="button" value="RESULTADO"onclick="suma();"/>
</body>
</html>
……………………………………………………………………………………………………………………………………………………………………………………………
Variable for:
<head>
<title>Ejemplo</title>
</head>
<body>
<p id="texto">ejemplo1</p>
<p id="texto1">ejemplo2</p>
<p id="texto2">ejemplo3</p>
<p...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • HTML
  • QUE ES HTML
  • Html
  • html
  • HTML
  • Html
  • Html
  • Html

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS