Skip to content

Instantly share code, notes, and snippets.

@leomicheloni
Created September 15, 2015 00:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leomicheloni/a2b85f0ce3bb426dde30 to your computer and use it in GitHub Desktop.
Save leomicheloni/a2b85f0ce3bb426dde30 to your computer and use it in GitHub Desktop.
<!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