I wrote a code that switches an image from Yes to No using jQuery.
$(function() {
$('#s-ref').click(function(){
$("#s-img").attr('src',"no.png");
});
});
html is:
<a href="#" id="s-ref"><img src="yes.png" alt="" id="s-img"></a>
How to modify the jQuery code above so that it switches back and force (yes/no/yes/no/yes…).
Check the img src…
Or… This would work if the scr contained ‘yes.png’ for example ‘/foo/barr/yes.png:
Here’s a fiddle to illustrate the latter answer – http://jsfiddle.net/nz35B/