The Lodge is members-only design/dev videos and Office Hours.

Next Office Hours Session: "Implementing an SVG Icon System" Nov 30 - 6:00 PM Eastern

[jQuery] check attribute

  • # February 15, 2010 at 10:42 pm

    Hey guys, I wanted to know if there was a way I can check if an ‘img’ tag has an ‘alt’ attribute, and if it doesn’t have an ‘alt’ attribute already set, it sets one?


    having the jQuery automatically turn it into this:


    The reason I ask is because I found out that if there is no alternate text set for images, it is becomes an error when validating.

    thanks for any help.

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

There's a whole bunch of content on CSS-Tricks.

Search for Stuff   •   Browse the Archives

Get the Newsletter ... or get the RSS feed