views:

146

answers:

3

Hello

assume that I have this list:

<ul id="carousel"> 
    <li><a title="hey"><img src="image.png"/></a></li>    
</div>

And now my jQuery script:

$(function() {  
    $("#carousel a").click(function(){
    var url = $(this).attr('title');
    alert(url);

    });
}); 

This doesn't work, it works for other attributes such as "alt", "rel" etc. I will be greatful for any assistance.

+5  A: 

Works for me in Safari 4 on Mac OS X. What browser are you using? Does the example I linked to fail for you?

Brian Campbell
A: 

Your example is perfect (because I did try it and it works) , if you using IE8 try to cleare the cache.

Florim Maxhuni
A: 

I believe it will not work in Firefox because of your invalid markup (as seen in Brian Campbell's link). IE8 seems to work fine following the same link. It would seem that IE8 does not care about closing the <ul>.

ChaosPandion