JSFiddle - React, Tailwind, and code Playground
HTML
<div class="links-list">
<a class="overtime_add_button" href="http://www.google.com/">To Google</a>
</div>
CSS
/* links one per line, for demo only. terrible way to do this */
a { display:block; }
JavaScript
$(document).on('click', 'a.overtime_add_button', function(e) {
e.preventDefault();
alert($(this).text()+'!');
});
$(function() {
// clone it a bunch of times, to show that the click event
// alert above still works on new elementsstill works
var cp = $('a.overtime_add_button'),
prnt = cp.parent();
for (var i=0; i<20; i++) {
var cloned = cp.clone();
cloned.text(cloned.text()+' - '+(i+1))
.appendTo(prnt);
}
});