jquery toggle button value

前端 未结 5 1145
自闭症患者
自闭症患者 2020-12-10 05:44

In the below code when the play button is clicked Its value should be changed to pause and when pause is clicked the other function should be called .How to do this using jq

5条回答
  •  一向
    一向 (楼主)
    2020-12-10 05:55

    $('#play_button_id').toggle(play,play_pause);
    

    this will trigger the play() function when you click the button for the first time

    and the play_pause() when you click the button for the second time

提交回复
热议问题