javascript - Open 1 modal with two different links -
so have page, modal. have table on page. want include link in each row of table opens same modal, , put different content in using jquery.
the problem i'm having in modals. when give 2 links id code
, , following in jquery:
$(document).ready(function() { $("#code").click(function() { $("#codemodal").modal('show') }); });
only first link opens modal.
i have tried data-toggle
, resulted in no links being able open modal.
is there way make possible? if so, how it?
thanks.
id
must unique. can assign same class links , this:
$(".code").click(function() { $("#codemodal").modal('show') });
Comments
Post a Comment