Matching

While creating an index page by copying & pasting links from different files I ended up with multiple instances of the same links which got me thinking as to how I could highlight all the duplicates within the page.

If more than one instance highlight the first instance in green and the other matches in red.

Reference elements in the page

Link One
Link Two
Link Three
Link Four
Link Five

Link One
Link Two
Link Two
Link Four

Link One
Link Two
Link Four



If more than one instance highlight the first instance in green and the other matches in red.

Reference array values