LoginSignup
15
12

More than 5 years have passed since last update.

jQueryオブジェクトの比較

Posted at

HTMLElementかis()で比較できる。

$(function(){

    var $hoge = $('#hoge');
    var _$hoge = $('#hoge');

    alert($hoge === _$hoge); // false
    alert(_$hoge.is($hoge)); // true
    alert($hoge[0] === _$hoge[0]); // true

});
15
12
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
15
12