applying the same .click event to two different divs

前端 未结 6 1383
孤独总比滥情好
孤独总比滥情好 2021-02-09 07:19

i have two different divs (code was simplified, this is not the actual code.)

6条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-09 07:51

    This should work

    ($('#test','#funt')).click(function(){alert('yes')});
    

    http://api.jquery.com/multiple-selector/

提交回复
热议问题