How to replace href with value of data-href?
<p>I have got html as below</p>

<pre><code>&lt;a href="" data-href="/somefile.php?id=10&amp;refcode=/test.php"&gt;Hello&lt;/a&gt;
</code></pre>

<p>and I need to replace href with the value  in data-href so that the above becomes something like </p>

<pre><code>&lt;a href="/somefile.php?id=10&amp;refcode=/test.php"&gt;Hello&lt;/a&gt;

//the following doesnt work .. 

$(function() {
 $('a[data-href]').attr('href', $(this).attr('data-href'));
});
</code></pre>

<p>Any suggestions? Basically I want to hide some links for some reason from search engines/bots etc. so I am happy if I can get the above working or if you can suggest any better idea to achieve the same? Thanks. </p>
