How can I toggle between 2 images

前端 未结 4 510
醉梦人生
醉梦人生 2020-12-13 16:29

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

4条回答
  •  天涯浪人
    2020-12-13 17:01

    You can use the .toggle() function. I've updated your fiddle. Also, you hadn't escaped the quotes properly in your image tags.

    $("#infoToggler").toggle(function() {
        $(this).html('');
    }, function() {
        $(this).html('');
    });​
    

提交回复
热议问题