A couple thoughts:
'alt' isn't a valid attribute of span; use 'title'.
Using jQuery doesn't necessarily equate to easier.
//POJS
for (var i = 0; i < elem.length; i++) {
if(!elem[i].title){elem[i].title="";}
}
//jQuery
$('span').each(function(){
if(!this.title){this.title="";}
});
On Apr 2
On Wed, Apr 29, 2009 at 3:17 PM, Andy wrote:
>
> Is there a way to grab the text from inside a alt tag? I have a site
> that will have tons of span tags and I need to go through all of them
> searching for the alt="" attribute then grab it.
>
>
> I'm using some non-jQuery javascript, so I'm sure
2 matches
Mail list logo