$('a[data-secondlink]').on('click',function(){ window.open($(this).data("secondlink')); });