Sol html

De wikiserver
La revisió el 18:44, 2 abr 2016 per Jnoguera (Discussió | contribucions) (Es crea la pàgina amb «<source lang="java"> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Método html de jQuery | Pablo Monteserín</title> <script type="text/java…».)
(dif) ← Versió més antiga | Versió actual (dif) | Versió més nova → (dif)
Dreceres ràpides: navegació, cerca
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Método html de jQuery | Pablo Monteserín</title>

	<script type="text/javascript" src="jquery.js"></script>
<script>
	$(document).ready(function(){
		$("#boton1").click(function(){
			$("#wrapper").html('<div style="background:red; width:300px; height:300px"></div>'); 
		});
		$("#boton2").click(function(){
			alert($("#wrapper").html());
		});
	});
</script>

</head>
<body>
	
<input type="button" id="boton1" value="Modificar código html del wrapper">
<input type="button" id="boton2" value="Recuperar el código html del wrapper">

<div id="wrapper">
</div>

</body>
</html>