Created
September 15, 2015 00:18
-
-
Save leomicheloni/a2b85f0ce3bb426dde30 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML> | |
<html lang="en-US"> | |
<head> | |
<meta charset="UTF-8"> | |
<script type="text/javascript" src="http://code.jquery.com/jquery.min.js"></script> | |
<title></title> | |
<script type="text/javascript"> | |
$(function(){ | |
$("#add").on("click", function(){ | |
var f = "<tr><td><span>hola</span><a href='JavaScript:void(0);'>Quitar</a></td></tr>"; | |
$("table").append(f); | |
}); | |
$(document).on("click", "td>a", function(){ | |
this.parentNode.remove(); | |
}); | |
}); | |
</script> | |
</head> | |
<body> | |
<table></table> | |
<button id="add">add</button> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment