JSFiddle - React, Tailwind, and code Playground
HTML
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.4/themes/ui-lightness/jquery-ui.css">
<div id="some_container"> <!-- this is present when the page loads -->
<a class="link">some button</a> <!-- this is present when the page loads -->
<a class="link">some button</a> <!-- this is present when the page loads -->
<a class="link">some button</a> <!-- this is present when the page loads -->
<span>some text</span> <!-- this one won't match the selector -->
<span>some text</span> <!-- this one won't match the selector -->
</div>
CSS
a {
display:block;
color:blue;
margin: 4px;
}
JavaScript
var i = 0,
intvl = setInterval(function() {
$('#some_container').append('<a class="link">some DYNAMIC button</a>');
if( ++i === 5 ) {
clearInterval( intvl );
}
},1000);
$('#some_container').delegate('a.link', 'click', function() {
alert('I was clicked');
});