How can I use two selectors in a jQuery function, to do the same actions?

后端 未结 2 859
無奈伤痛
無奈伤痛 2020-12-22 13:08

I want to do the same action for two selectors. I need something like this:

$(\"#ddlSuperFuncao or #ddlMeta\").on(\'change\', function () {
     alert(\'Same         


        
2条回答
  •  自闭症患者
    2020-12-22 13:35

    You can use as following:

      $("#ddlSuperFuncao, #ddlMeta").on('change', function () {
             alert('Same action when I change one div or other');
      }
    

    For more information read it from here.

提交回复
热议问题