This way is similar to the above solutionprevious solutions, but implemented differently:
.social_icon -> some class with CSS
<div class="social_icon" id="SOME_ID" data-url="SOME_URL"></div> $('.social_icon').click(function(){ var url = $(this).attr('data-url'); var win = window.open(url, '_blank'); ///similar to above solution win.focus(); });