1 line
1.2 KiB
JSON
1 line
1.2 KiB
JSON
{"name":"jQuery.fn.extend","type":"method","title":"jQuery.fn.extend()","deprecated":null,"removed":null,"desc":"Merge the contents of an object onto the jQuery prototype to provide new jQuery instance methods.","categories":["utilities","version/1.0"],"entries":[{"return":"Object","signatures":{"added":"1.0","argument":{"desc":"An object to merge onto the jQuery prototype.","name":"object","type":"Object"}},"examples":{"desc":"Add two methods to the jQuery prototype (<code>$.fn</code>) object and then use one of them.","code":"\njQuery.fn.extend({\n check: function() {\n return this.each(function() {\n this.checked = true;\n });\n },\n uncheck: function() {\n return this.each(function() {\n this.checked = false;\n });\n }\n});\n\n// Use the newly created .check() method\n$( \"input[type='checkbox']\" ).check();\n","css":"\n label {\n display: block;\n margin: .5em;\n }\n","html":"\n<label><input type=\"checkbox\" name=\"foo\"> Foo</label>\n<label><input type=\"checkbox\" name=\"bar\"> Bar</label>\n"},"longdesc":"\n The <code>jQuery.fn.extend()</code> method extends the jQuery prototype (<code>$.fn</code>) object to provide new methods that can be chained to the <code>jQuery()</code> function.\n "}]} |