ボタンでモーダルインラインを作成すると...それぞれがクリックされたときに特定のアクションを実行できるようにしたい。ただし、モーダルで生成されたこれらのボタンをつかむことができません。
これらを取得する方法を知っている人はいますか?
$('.open-popup-link').magnificPopup({
items: {
type: 'inline',
src: $('<div class="white-popup">\
<h4>Are you sure you were discharged for failing a drugs test?</h4>\
<p>You will not be able to change your answer once you have submitted these details.</p>\
<button id="test-popup-no">No, I\'ve made a mistake</button>\
<button id="test-popup-yes">Yes, I\'m sure</button>\
</div>')
},
type: 'inline',
midClick: true
});
各ボタンがクリックされたときに、その ID に応じて異なるアクションを実行したいと思います。
できれば助けてください。私はこれに苦労してきました。標準のjQuery選択を行うだけではうまくいかないようです。
ありがとう、マイケル。