ドキュメント

Core/jQuery.fn.extend

From jQuery JavaScript Library

Jump to: navigation, search

« Back to Core

jQuery.fn.extend( object )

Extends the jQuery element set to provide new methods (used to make a typical jQuery plugin).
Can be used to add functions into the to add plugin methods (plugins).
Arguments:
objectObject
The object that will be merged into the jQuery object.
Examples:

Adds two plugin methods.

jQuery.fn.extend({
  check: function() {
    return this.each(function() { this.checked = true; });
  },
  uncheck: function() {
    return this.each(function() { this.checked = false; });
  }
});

$("input:checkbox").check();
$("input:radio").uncheck();

NameType