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? Quote Link to comment 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> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.