Can a single modal be opened on the same HTML page from two different JavaScript files?
Suppose I am currently on the homepage. When I click a navigation button, it triggers the openModal function and should display the modal below.
Homepage.html
<div id="Homepage-modal" class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<div class="cart-container">
<div @click="goToStore()">
<div class="button">Click Me</div>
</div>
</div>
</div>
</div>
</div>
Homepage.js
function (openModal){
$('#Homepage-modal').modal('show');
}
Is it possible for me to click the same button on a different page using a different JS file to display the same modal from homepage.html without duplicating the modal in menu.html?