Find duplicated id and remove the one with JQuery


/ Published in: jQuery
Save to your folder(s)



Copy this code and paste it in your HTML
  1. //Featured article fix//
  2. var myFeatured = $('body.front div.featured').attr('id');
  3. var theHidden;
  4.  
  5. $('body.front .front-latest-news div.article').each(function(){
  6. theHidden = $(this).attr('id');
  7.  
  8.  
  9. if(theHidden == myFeatured){
  10. $('body.front div.front-latest-news div#'+theHidden).hide();
  11. }
  12. });

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.