Im trying to use this code to toggle between a play and pause button but it doesn't seem to be working. How can I get it toggle between the 2 images when the are clicked
http://jsfiddle.net/aFzG9/1/
$("#infoToggler").click(function()
{
if($(this).html() == "<img src="http://tympanus.net/PausePlay/images/play.png" width="60px" height="60px"/>")
{
$(this).html("<img src="http://maraa.in/wp-content/uploads/2011/09/pause-in-times-of-conflict.png width="60px" height="60px"/>");
}
else
{
$(this).html("<img src="http://tympanus.net/PausePlay/images/play.png" width="60px" height="60px"/>");
}
});
Thanks
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…