Compare links and highlight them if they are matching
Hi,
I have a table which has two columns (#colA and #colB) , each column contains links, I want to compare the links in #colA to #colB and highlight them in both columns if they are exactly matching links.
So far I have done this but not really working, how can I correct this?
- $(document).ready(function() {
- $("#colA a").each(function() {
- var hreftofind = $(this).attr("href");
- $('#colB a[href$="'+hreftofind+'"]').addClass('selected');
- });
- });