$(document).ready(function(){ $("a[data-href]").each(function(){ $(this).attr('href', $(this).attr('data-href')); }); });