javascript - Difference in referring this variable in jquery -


i confused between variable in below code.

jquery.fn.extend({    check: function() {      return this.each(function() {        this.checked = true;      });    },    uncheck: function() {       return this.each(function() {         this.checked = false;       });    }  });  // use newly created .check() method $( "input[type='checkbox']" ).check(); 

please tell me this refers object.

in this.each, this refers collection of elements in provided jquery object. in example, all of input[type="checkbox"] elements.

in this.checked, this single domelement within iteration of each loop.


Comments

Popular posts from this blog

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -