views:

218

answers:

2

Is there something unique about Safari that would render the code below useless? While it works as expected in all the other browsers, it fails in Safari, insomuch that the attribute isn't removed at all...

$('ul.nice-menu a').each(function() {
    $(this).removeAttr('title');
});
A: 

There's no need for an each loop. Try the following:

$('ul.nice-menu a').removeAttr("title");

I'm not sure that will fix it though.

karim79
I just tested `removeAttr` on anchors with titles on safari, seems fine (jQuery 1.4.1). Is your $(document).ready?
karim79
yes... It works in everything but Safari.
phpN00b
Can you upgrade the jQuery 1.4.1, see if the bug still exist. Also, do you use the latest Safari?
Donny Kurnia
A: 

Not a real response, but have you tried

$(this).attr('title','');  

?

Stefan Kendall
That's exactly the behavior I'm trying to avoid... It outputs a blank title, which is causing problems.
phpN00b