jQuery objects of the same element are not equal?

前端 未结 5 1629
梦毁少年i
梦毁少年i 2021-01-17 23:39

This must be something I\'m overlooking, but please look at the following page and JavaScript and tell me why, for everything that\'s holy, jQuery won\'t return true?

<
5条回答
  •  死守一世寂寞
    2021-01-18 00:08

    You could do this, a comparison of the HTML nodes. Which if you want to compare HTML objects is the correct way to do it.

    if (t[0] === s[0]) {
        console.log('yes');
    }
    

提交回复
热议问题