JSFiddle - React, Tailwind, and code Playground

by jrobens

HTML

<body>

<a data-action="custom-modal" href="test_modal_content1.html">Test 1</a>
<a data-action="custom-modal" href="test_modal_content2.html">Test 2</a>

<div class="modal modal-6 fade" id="modal-form" role="dialog" aria-labelledby="modalFormLabel" aria-hidden="true">
    <div class="modal-content"></div>
</div>

</body>

JavaScript

function TestModal() {
}

TestModal.prototype.toggleModal = function () {
    $('body').delegate('a[data-action=custom-modal]', 'click', function (ev) {
        $(ev).preventDefault();
    });
};

var testModal = new TestModal();
testModal.toggleModal();