3👍
✅
After adding a new class, you must remove the previous class from the element’s classlist. So the modal won’t seem to work anymore after having both classes at the same time.
for ex.
function changeVisibility(modal) {
if(modal.classList.contains('open-modal')) {
modal.classList.remove('open-modal');
modal.classlist.add('close-modal');
} else {
modal.classList.remove('close-modal');
modal.classList.add('open-modal')
}
}
0👍
If your trying to do modals, you should use HTML’s <dialog>
element (Also see HTMLDialogElement
). MDN has a tutorial on it.
- [Django]-In django allauth, how do I get the username from an OpenId login / Google?
- [Django]-Using a static website generator for a blog on a dynamic website?
- [Django]-Get method classname inside decorator at __init__ in python
- [Django]-Django-haystack elasticsearch as backend and searchengine
- [Django]-Django annotate group by date return object
Source:stackexchange.com