-1

I wrote a short jQuery script to add alt text to A tags using their title attribute values.

var anchors=$('a.className');
anchors.each(function(){ //CYCLE THRU EACH SUBCAT ON PAGE
 var title=$(this).attr('title'); //GET TITLE VALUE
 $(this).attr('alt',title); //SET TITLE VALUE TO ALT ATTRIBUTE
});

It works perfectly but I'm concerned it may not serve its purpose. Does adding alt tags in this way help with SEO? Do engines like Google care if an alt tag is generated AFTER the page has already loaded? Is there a way around this?

FYI: I know it is very simple to just add an alt tag usually, but in my case, that doesn't seem to be an option.

Logik
  • 13
  • 7

1 Answers1

1

To my knowledge, most web crawlers ignore all javascript. So adding the ALT attributes after will not help with the SEO.

See here how do web crawlers handle javascript

Edit: It's still a good idea to add them any way you can though (for images specifically), in order to keep your site ADA compliant.

Community
  • 1
  • 1
XNargaHuntress
  • 751
  • 6
  • 11