sábado, 15 de febrero de 2014

Ejercicio 002

El siguiente ejercicio me permite modificar
- El tamaño,
- Forma,
- Color y Contenido de un DIV
Además cambia el Texto dentro de un Botón










<!DOCTYPE html>

<!--Permite cambiar la forma de un Div existente, su contenido y el contenido del Boton de la pagina -->

<html>

<head>
<style type="text/css">
#caja { width:200px; height:60px; background-color:green; color:white; font-size:15px; text-align:center; }
</style>
</head>

<body>
   <div id="caja">Aqui esta el div rojo </div>
   <br>
   <input id="miboton" type="button" onClick="cambios()" value="Clic aca para los cambios del div rojo arriba" />
</body>

<script language="javascript">
function cambios(){
document.getElementById("caja").style.width = "500px";
document.getElementById("caja").style.height = "450px";
document.getElementById("caja").style.fontSize = "62px";
   document.getElementById("caja").style.textAlign = "center";
   document.getElementById("caja").style.backgroundColor = "#FFB3B3";
   document.getElementById("caja").style.border = "4px dashed red";
   document.getElementById("caja").style.color = "black";
   document.getElementById("caja").innerHTML="Se puede insertar Estilo y contenido de elementos en un Div";
   document.getElementById("miboton").value = "Y funciona";
   }
</script>

</html>










No hay comentarios:

Publicar un comentario