Can someone tell me why this jquery does not work?
<script type="text/javascript">
jQuery('a').each(function(){
jQuery("#get-pricing-now-button-hotfix8").attr("href", "/en/starting-prices/");
});
</script>
I have a few buttons on the page which have an id value of get-pricing-now-button-hotfix8 and I need the ahref value for those links switch to /en/starting-prices/.
I was able to get it working for one link using the following but only changes 1 single button.
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery("#get-pricing-now-button-hotfix8").attr("href","/en/starting-prices/");
});
</script>
Please help!
each
logic doesn't make much sense either<a>
is current instance in the loop