Skip to content

Instantly share code, notes, and snippets.

@ricardosiri68
Created July 10, 2015 06:14
Show Gist options
  • Select an option

  • Save ricardosiri68/87f28d8065a6505d6671 to your computer and use it in GitHub Desktop.

Select an option

Save ricardosiri68/87f28d8065a6505d6671 to your computer and use it in GitHub Desktop.
<h1>Div refrescado</h1><br>
<h2 id="texto123" style="display: none;"> Ahora se muestra </h2><br>
<div>
<input type="button" value="Mostrar" onClick="mostrar()">
<br>
<input type="button" value="Recargar" id="refrescar">
</div>
<html>
<script src="http://code.jquery.com/jquery-2.1.4.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#refrescar").bind("click", function() {
$("#midiv").load("/div_refrescado.php");
});
});
function mostrar(){
elemento = document.getElementById("texto123");
if(elemento.style.display=="")
{
elemento.style.display="none";
}
else
{
elemento.style.display="";
}
}
</script>
<body>
<div align="center"> <span> P&aacute;gina</span> </div>
<div id="midiv" align="center">
<h1>Div recargado</h1><br>
<h2 id="texto123" style="display: none;"> Ahora se muestra </h2><br>
<div>
<input type="button" value="Mostrar" onClick="mostrar()">
<br>
<input type="button" value="Recargar" id="refrescar">
</div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment