How to use Attr() function no only for the first element?

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.

  1. // Highlight thumbnail on roll over post list item
  2. $("#sidebar-left .left-col2 a").live("hover", function(){
  3. var title2 = $(this).attr("title");
  4. alert("title : " + title2);
  5. if ($("#portfolio-list li a").attr('title') == title2 ) { $("#portfolio-list li a[title="+title2+"]").parent().css({"border": "1px solid red"}); }
  6. });

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