I use standart js and jQuery.
I have standart modal window. And since that have the following mehtods.
function closeModal(modal) {
modal.css('display', 'none');
return false;
}
function openModal(modal) {
modal.css('dislay', 'block');
return false;
}
<a href="#ModalAdd" onclick="openModal($('#ModalAdd'))" class="add">Add</a>
$('#ModalAdd').css('display', 'block')
$('#ModalAdd').css('display', 'none')
Remove the typo
function openModal(modal) {
modal.css('display', 'block');
return false;
}
Also toggle the display instead.
function Modal(modal){
$(this).toggle(display);
}