1var ignoreClickOnMeElement = document.getElementById('someElementID');
2
3document.addEventListener('click', function(event) {
4 var isClickInsideElement = ignoreClickOnMeElement.contains(event.target);
5 if (!isClickInsideElement) {
6 //Do something click is outside specified element
7 }
8});