Código HTML:
Ver original<!DOCTYPE HTML>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script> <script type="text/javascript"> $(function(){
$("#new").click(function(){ newform() });
$("#mascota form").submit(function(){
alert($(this).serialize());
return false;
})
})
function newform() {
var div = document.createElement("div");
div.innerHTML = document.getElementById("mascota").innerHTML;
document.getElementById("new_mascota").appendChild(div);
$("form",div).submit(function(){
alert($(this).serialize());
return false;
})
}
form{border: 1px solid #555; width: 300px; padding: 8px;}
#mascota{padding: 8px; background: #DDD;}
#new_mascota{padding: 8px; background: #AAA;}
h4{margin: 0px;}
<form action=""><input type="text" name="text"/><input type="submit" value="Enviar"/></form>