I am inserting link elements and would like to share the clicks, but I'm not getting .. The test code:
<html>
<title></title>
<head>
<script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#teste").click(function(){
$("body").append($("<a>").text("Element A"));
});
$("a").click(function(){
alert("oi");
});
});
</script>
</head>
<body>
<input type="button" value="INSERT A" id="teste" />
</body>
</html>