I have around 8 img src tags that start like this:
<img src="" id="joinCityResponse" class="joinResponse"/>
If a related question is answered correctly then jQuery adds in the src field.
src="http://www.staticimages.co/dating/online-dating-index/join_tick.png"
At the end of the 8 questions I have a Join Now button and I need to be able to know if all the questions have been answered correctly. eg: have the above src url set.
How can I use jQuery to check all img tags with the class ‘joinResponse’ have the scr as set above?
Try:
This will get all images with
joinResponseclass and then return only those that have thesrcattribute set tourlvalue (replaceurlwith your png url).I would recommend you insteadto just set another class that will mark correctly answered answers. Then you can just check the number of elements with this class. The advantages are: