How to use Attr() function no only for the first element?
Hi everybody,
I've made a script to highlight an element when you rollover on another one.
- // Highlight thumbnail on roll over post list item
- $("#sidebar-left .left-col2 a").live("hover", function(){
- var title2 = $(this).attr("title");
- alert("title : " + title2);
-
- if ($("#portfolio-list li a").attr('title') == title2 ) { $("#portfolio-list li a[title="+title2+"]").parent().css({"border": "1px solid red"}); }
-
- });
My problem is that the script works fine but unfortunatly just for the first li element that I rollover...
How can I make it for each one?
Regards