[jQuery] Re: dynamically add link after certain hrefs

2009-06-16 Thread brian
Maybe something like this: $('a').each(function() { var self = this; var btn_link = $('a href=#'+$(self).text()+'/a'); var href = $(self).attr('href'); // to be used in modal code $(btn_link).click(function() { // set up your modal

[jQuery] Re: dynamically add link after certain hrefs

2009-06-16 Thread mkmanning
You can simplify your approach; it's not necessary to copy the properties to the new link as you can just get them at runtime when the link is clicked (you also don't need to iterate over all the anchors): $('a href=/modalwindow.htmlimg src=/images/button.jpg// a').click(function(){ var