I think there's an easy answer, but I can't find the right solution for this. I know that it has to be done with querySelectorAll
, but can't figure out how to use it in this case.
I have elements with ID's #modalA
, #modalB
and #modalC
. I don't want to duplicate code. So I want to figure out what is the best practice for this?
Can't use getElementByClassName, because I can't make changes to markup.
var getModalsA = document.getElementById('modalA');
var getModalsB = document.getElementById('modalB');
var getModalsC = document.getElementById('modalC');
getModalsA.addEventListener('touchmove', function(e) {
e.preventDefault();
}, false);