I was thinking of writing some code in PHP to change all the ids of images to match their alts. Would this be easier to implement in jQuery?
What i need to do is take this line
img alt=”puzzle” src=”images/cole.jpg” alt=”This is me” style=”display:none;” />
and make it
img id=”puzzle” alt=”puzzle” src=”images/cole.jpg” alt=”This is me” style=”display:none;” />
Shift as much as possible to the server. Also what if the user has a javascript blocker on ?
But I would have to ask why would you want to do this?
But alt tags may have spaces, this means you could set a possibly invalid id!
EDIT
Now you have edited your answer:
That first
imgtag is invalid html, you cannot have 2alttags and jQuery will not be able to deal with it.