$(document).ready( function () { $('[data-url]').on('click', function() { window.location.href = $(this).data('url'); }); });