I created some elements on the fly by JavaScript like this:
tmpString += '<a class="small_text add" id="' + variable_id + '_add" href="#" > add </a>';
$('#mydiv').html(tmpString);
Problem
jQuery functions don’t work on these ‘on the fly’ elements, but the same jQuery functions work on other normal elements (like “a” tags in my site menu).
This is my jQuery code:
$('a').click(function(){ e.preventDefault(); alert(1); });
You need to use live or delegate.