Questions
I think the easiest approach would be to just check that el is not null before adding an event listener:
el
var el = document.getElementById('overlayBtn'); if(el){ el.addEventListener('click', swapper, false); }
~ Answered on 2014-09-29 19:14:37