jquery - disable links on dynamically created elements -
i have app can create elements, i.e. text-element , append div
and can add link element.
but can't disable link within div (not removing attr. disable it)
i looking this:
$('#container a').click(function() { e.preventdefault(); });
to disable links within div.container? possible?
you can use delegated events on method, designed handle exact situation you're describing:
$('#container').on('click', 'a', function(e) { e.preventdefault(); });
Comments
Post a Comment