Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript multiple enventListeners in one

document.addEventListener('click', function (event) {

	if (event.target.matches('.modal-open')) {
		// Run your code to open a modal
	}

	if (event.target.matches('.close')) {
		// Run your code to close a modal
	}

}, false);
Source by gomakethings.com #
 
PREVIOUS NEXT
Tagged: #javascript #multiple #enventListeners
ADD COMMENT
Topic
Name
5+7 =