How to use one click event handler for multiple buttons

后端 未结 4 947
名媛妹妹
名媛妹妹 2020-12-10 08:37

I have 4 buttons with different id\'s. When i click on them i need to perform one function. So i need something like this:

$(\'#button #button\').click(funct         


        
4条回答
  •  萌比男神i
    2020-12-10 09:41

    Easiest would be to add a class to all your buttons like so:

    $('.button_action').click(function()
    

提交回复
热议问题