LoginSignup
1

More than 5 years have passed since last update.

jsの thisで取れる値 と $("#hoge") で取れる値の違い

Last updated at Posted at 2017-06-06

実は違った。

index.js
<script type="text/javascript">
    $("#hoge").change(function() {
        console.log(this==$("#hoge")[0]);  //true
        console.log(this==$("#hoge"));   //false
    });
</script>

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
1