Test if two elements are the same

前端 未结 7 1453
予麋鹿
予麋鹿 2020-12-07 21:32

I would suspect this to work at first:

if ($(\'#element\') == $(\'#element\')) alert(\'hello\');

But it does not. How does one test if ele

7条回答
  •  南方客
    南方客 (楼主)
    2020-12-07 22:19

    Or just

    if (openActivity[0] == this) alert('hello');
    

    (without a new jQuery instance ;-)

提交回复
热议问题