0

I have a problem in my project. I want to replace > to ». I used this jquery to change it. But only one element is changing. Second one is not change. This is HTML:

<div id="breadcrumbs"><a href="#" class="home">Home</a> &gt; <a href="#">Second-page</a> &gt; Third-page</div>

This is jquery:

jQuery("#breadcrumbs").html(jQuery("#breadcrumbs").html().replace('&gt;', '»'));

Thanks.

sameeuor
  • 664
  • 7
  • 17

1 Answers1

-1
jQuery("#breadcrumbs").each(function(){
    jQuery(this).html(jQuery(".breadcrumbs").html().replace('&gt;', '»'));
})

I think this will help , small remark: don't put more that one ID on page, use classes inside.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Victor Sitnic
  • 380
  • 2
  • 6