$(function(){ $(document).click(function(event) { //console.log(event.target.id); var element = event.target.id; if(element == 'container'){ window.open('http://'+skinLink, '_blank'); } }); });