scferg Posted February 10, 2008 Share Posted February 10, 2008 Is it just me, or is it really annoying to apply alt tags to all of the images? I'm not experienced in javascript, so I thought I'd ask the pros. Is there any possible way to have a code that will set alt tags for all images on the page? Link to comment https://forums.phpfreaks.com/topic/90315-universal-alts/ Share on other sites More sharing options...
phpQuestioner Posted February 10, 2008 Share Posted February 10, 2008 Put the right above your </body> tag: <script language="javascript"> for (i=0; i<document.images.length; i++) { document.getElementsByTagName('img')[i].alt='Alternate Text Here'; } </script> Link to comment https://forums.phpfreaks.com/topic/90315-universal-alts/#findComment-463115 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.