Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Triggering a link if wrapped in an tag Reply To: Triggering a link if wrapped in an tag

#296999
j7f4f2a4fds2
Participant

by changing e.target to e.currentTarget , it worked.

$(‘.modal-button’).click(e => {
e.preventDefault();
$(e.currentTarget).closest(‘.modal’).add(‘body’).addClass(‘open’);
openModals.push($($(e.currentTarget).attr(‘href’)).show());
});