🤯 50% Off! 700+ courses, assessments, and books

jQuery Find and Remove Duplicated Element IDs

Sam Deering

This example could be used to fix a featured article for your blogs so that not more than one article is featured on the homepage.

// featured article fix
var myFeatured = $('div.featured').attr('id');
var theHidden;
	theHidden = $(this).attr('id');
	if(theHidden == myFeatured){