[ create a new paste ] login | about

Link: http://codepad.org/ohwzIw9Y    [ raw code | fork ]

Willmedina - Plain Text, pasted on Feb 3:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Ocultando Divs</title>

<script language="javascript" type="text/javascript">
		function MostrarDiv(){
			var div = document.getElementById('divOculto'); //obtiene el div como una variable mediante getelementbyid
	        div.style.display = ''; //cambia la propiedad del div del display de su style (eso sono bien charly jaja :D)
		}
		
		function OcultarDiv(){
			var div = document.getElementById('divOculto');
	        div.style.display='none';
		}
</script>

</head>

<body>
<input name="btnMostrar" type="button" value="Mostrar Div" onclick="MostrarDiv()" />
<br /><br />
<div style="display:none;" id="divOculto"><img src="http://i48.tinypic.com/11t5poy.png" border="0" /><br />
    <input name="btnOcultar" type="button" value="Ocultar Div" onclick="OcultarDiv()" />
</div>
</body>
</html>


Create a new paste based on this one


Comments: