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

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -