⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 docs.js

📁 JQuery的api文档
💻 JS
📖 第 1 页 / 共 5 页
字号:
var docdb=[{"cat":"Core","desc":"Create a new jQuery Object","params":[],"short":"Create a new jQuery Object","examples":[],"constructor":[1],"tests":["ok( Array.prototype.push, \"Array.push()\" );\nok( Function.prototype.apply, \"Function.apply()\" );\nok( document.getElementById, \"getElementById\" );\nok( document.getElementsByTagName, \"getElementsByTagName\" );\nok( RegExp, \"RegExp\" );\nok( jQuery, \"jQuery\" );\nok( $, \"$()\" );"],"private":1,"name":"jQuery"},{"short":"This function accepts a string containing a CSS selector,\nbasic XPath, or raw HTML, which is then used to match a set of elements.","params":[{"type":"String","desc":"An expression to search with, or a string of HTML to create on the fly.","name":"expr"}],"desc":"This function accepts a string containing a CSS selector,\nbasic XPath, or raw HTML, which is then used to match a set of elements.\nThe HTML string is different from the traditional selectors in that\nit creates the DOM elements representing that HTML string, on the fly,\nto be (assumedly) inserted into the document later.\n\nThe core functionality of jQuery centers around this function.\nEverything in jQuery is based upon this, or uses this in some way.\nThe most basic use of this function is to pass in an expression\n(usually consisting of CSS or XPath), which then finds all matching\nelements and remembers them for later use.\n\nBy default, $() looks for DOM elements within the context of the\ncurrent HTML document.","tests":[],"type":"jQuery","name":"$","examples":[{"desc":"This finds all p elements that are children of a div element.","before":"<p>one</p> <div><p>two</p></div> <p>three</p>","code":"$(\"div > p\")","result":"[ <p>two</p> ]"},{"desc":"Creates a div element (and all of its contents) dynamically, \nand appends it to the element with the ID of body. Internally, an\nelement is created and it's innerHTML property set to the given markup.\nIt is therefore both quite flexible and limited.","code":"$(\"<div><p>Hello</p></div>\").appendTo(\"#body\")"}],"cat":"Core"},{"short":"This function accepts a string containing a CSS selector, or\nbasic XPath, which is then used to match a set of elements with the\ncontext of the specified DOM element, or document","params":[{"type":"String","desc":"An expression to search with.","name":"expr"},{"type":"Element","desc":"A DOM Element, or Document, representing the base context.","name":"context"}],"desc":"This function accepts a string containing a CSS selector, or\nbasic XPath, which is then used to match a set of elements with the\ncontext of the specified DOM element, or document","tests":[],"type":"jQuery","name":"$","examples":[{"desc":"This finds all div elements within the specified XML document.","code":"$(\"div\", xml.responseXML)"}],"cat":"Core"},{"short":"Wrap jQuery functionality around a specific DOM Element.","params":[{"type":"Element","desc":"A DOM element to be encapsulated by a jQuery object.","name":"elem"}],"desc":"Wrap jQuery functionality around a specific DOM Element.\nThis function also accepts XML Documents and Window objects\nas valid arguments (even though they are not DOM Elements).","tests":[],"type":"jQuery","name":"$","examples":[{"code":"$(document).find(\"div > p\")","result":"[ <p>two</p> ]","before":"<p>one</p> <div><p>two</p></div> <p>three</p>"},{"desc":"Sets the background color of the page to black.","code":"$(document.body).background( \"black\" );"}],"cat":"Core"},{"short":"Wrap jQuery functionality around a set of DOM Elements.","params":[{"type":"Array<Element>","desc":"An array of DOM elements to be encapsulated by a jQuery object.","name":"elems"}],"desc":"Wrap jQuery functionality around a set of DOM Elements.","tests":[],"type":"jQuery","name":"$","examples":[{"desc":"Hides all the input elements within a form","code":"$( myForm.elements ).hide()"}],"cat":"Core"},{"short":"A shorthand for $(document).","params":[{"type":"Function","desc":"The function to execute when the DOM is ready.","name":"fn"}],"desc":"A shorthand for $(document).ready(), allowing you to bind a function\nto be executed when the DOM document has finished loading. This function\nbehaves just like $(document).ready(), in that it should be used to wrap\nall of the other $() operations on your page. While this function is,\ntechnically, chainable - there really isn't much use for chaining against it.\nYou can have as many $(document).ready events on your page as you like.","tests":[],"type":"jQuery","name":"$","examples":[{"desc":"Executes the function when the DOM is ready to be used.","code":"$(function(){\n  // Document is ready\n});"}],"cat":"Core"},{"short":"A means of creating a cloned copy of a jQuery object.","params":[{"type":"jQuery","desc":"The jQuery object to be cloned.","name":"obj"}],"desc":"A means of creating a cloned copy of a jQuery object. This function\ncopies the set of matched elements from one jQuery object and creates\nanother, new, jQuery object containing the same elements.","tests":[],"type":"jQuery","name":"$","examples":[{"desc":"Locates all p elements with all div elements, without disrupting the original jQuery object contained in 'div' (as would normally be the case if a simple div.find(\"p\") was done).","code":"var div = $(\"div\");\n$( div ).find(\"p\");"}],"cat":"Core"},{"property":1,"cat":"Core","type":"String","desc":"The current version of jQuery.","params":[],"short":"The current version of jQuery.","examples":[],"tests":[],"private":1,"name":"jquery"},{"property":1,"cat":"Core","type":"Number","desc":"The number of elements currently matched.","params":[],"short":"The number of elements currently matched.","examples":[{"code":"$(\"img\").length;","result":"2","before":"<img src=\"test1.jpg\"/> <img src=\"test2.jpg\"/>"}],"tests":["ok( $(\"div\").length == 2, \"Get Number of Elements Found\" );"],"name":"length"},{"short":"The number of elements currently matched.","params":[],"desc":"The number of elements currently matched.","tests":["ok( $(\"div\").size() == 2, \"Get Number of Elements Found\" );"],"type":"Number","name":"size","examples":[{"code":"$(\"img\").size();","result":"2","before":"<img src=\"test1.jpg\"/> <img src=\"test2.jpg\"/>"}],"cat":"Core"},{"short":"Access all matched elements.","params":[],"desc":"Access all matched elements. This serves as a backwards-compatible\nway of accessing all matched elements (other than the jQuery object\nitself, which is, in fact, an array of elements).","tests":["isSet( $(\"div\").get(), q(\"main\",\"foo\"), \"Get All Elements\" );"],"type":"Array<Element>","name":"get","examples":[{"code":"$(\"img\").get();","result":"[ <img src=\"test1.jpg\"/> <img src=\"test2.jpg\"/> ]","before":"<img src=\"test1.jpg\"/> <img src=\"test2.jpg\"/>"}],"cat":"Core"},{"short":"Access a single matched element.","params":[{"type":"Number","desc":"Access the element in the Nth position.","name":"num"}],"desc":"Access a single matched element. num is used to access the\nNth element matched.","tests":["ok( $(\"div\").get(0) == document.getElementById(\"main\"), \"Get A Single Element\" );"],"type":"Element","name":"get","examples":[{"code":"$(\"img\").get(1);","result":"[ <img src=\"test1.jpg\"/> ]","before":"<img src=\"test1.jpg\"/> <img src=\"test2.jpg\"/>"}],"cat":"Core"},{"cat":"Core","type":"jQuery","desc":"Set the jQuery object to an array of elements.","params":[{"type":"Elements","desc":"An array of elements","name":"elems"}],"short":"Set the jQuery object to an array of elements.","examples":[{"code":"$(\"img\").get([ document.body ]);","result":"$(\"img\").get() == [ document.body ]"}],"tests":[],"private":1,"name":"get"},{"short":"Execute a function within the context of every matched element.","params":[{"type":"Function","desc":"A function to execute","name":"fn"}],"desc":"Execute a function within the context of every matched element.\nThis means that every time the passed-in function is executed\n(which is once for every element matched) the 'this' keyword\npoints to the specific element.\n\nAdditionally, the function, when executed, is passed a single\nargument representing the position of the element in the matched\nset.","tests":["var div = $(\"div\");\ndiv.each(function(){this.foo = 'zoo';});\nvar pass = true;\nfor ( var i = 0; i < div.size(); i++ ) {\n  if ( div.get(i).foo != \"zoo\" ) pass = false;\n}\nok( pass, \"Execute a function, Relative\" );"],"type":"jQuery","name":"each","examples":[{"code":"$(\"img\").each(function(){\n  this.src = \"test.jpg\";\n});","result":"<img src=\"test.jpg\"/> <img src=\"test.jpg\"/>","before":"<img/> <img/>"},{"code":"$(\"img\").each(function(i){\n  alert( \"Image #\" + i + \" is \" + this );\n});","result":"<img src=\"test.jpg\"/> <img src=\"test.jpg\"/>","before":"<img/> <img/>"}],"cat":"Core"},{"short":"Searches every matched element for the object and returns\nthe index of the element, if found, starting with zero.","params":[{"type":"Object","desc":"Object to search for","name":"obj"}],"desc":"Searches every matched element for the object and returns\nthe index of the element, if found, starting with zero. \nReturns -1 if the object wasn't found.","tests":["ok( $([window, document]).index(window) == 0, \"Check for index of elements\" );\nok( $([window, document]).index(document) == 1, \"Check for index of elements\" );\nvar inputElements = $('#radio1,#radio2,#check1,#check2');\nok( inputElements.index(document.getElementById('radio1')) == 0, \"Check for index of elements\" );\nok( inputElements.index(document.getElementById('radio2')) == 1, \"Check for index of elements\" );\nok( inputElements.index(document.getElementById('check1')) == 2, \"Check for index of elements\" );\nok( inputElements.index(document.getElementById('check2')) == 3, \"Check for index of elements\" );\nok( inputElements.index(window) == -1, \"Check for not found index\" );\nok( inputElements.index(document) == -1, \"Check for not found index\" );"],"type":"Number","name":"index","examples":[{"code":"$(\"*\").index(document.getElementById('foobar'))","result":"0","before":"<div id=\"foobar\"></div><b></b><span id=\"foo\"></span>"},{"code":"$(\"*\").index(document.getElementById('foo'))","result":"2","before":"<div id=\"foobar\"></div><b></b><span id=\"foo\"></span>"},{"code":"$(\"*\").index(document.getElementById('bar'))","result":"-1","before":"<div id=\"foobar\"></div><b></b><span id=\"foo\"></span>"}],"cat":"Core"},{"short":"Access a property on the first matched element.","params":[{"type":"String","desc":"The name of the property to access.","name":"name"}],"desc":"Access a property on the first matched element.\nThis method makes it easy to retrieve a property value\nfrom the first matched element.","tests":["ok( $('#text1').attr('value') == \"Test\", 'Check for value attribute' );\nok( $('#text1').attr('type') == \"text\", 'Check for type attribute' );\nok( $('#radio1').attr('type') == \"radio\", 'Check for type attribute' );\nok( $('#check1').attr('type') == \"checkbox\", 'Check for type attribute' );\nok( $('#simon1').attr('rel') == \"bookmark\", 'Check for rel attribute' );\nok( $('#google').attr('title') == \"Google!\", 'Check for title attribute' );\nok( $('#mark').attr('hreflang') == \"en\", 'Check for hreflang attribute' );\nok( $('#en').attr('lang') == \"en\", 'Check for lang attribute' );\nok( $('#simon').attr('class') == \"blog link\", 'Check for class attribute' );\nok( $('#name').attr('name') == \"name\", 'Check for name attribute' );\nok( $('#text1').attr('name') == \"action\", 'Check for name attribute' );\nok( $('#form').attr('action').indexOf(\"formaction\") >= 0, 'Check for action attribute' );"],"type":"Object","name":"attr","examples":[{"code":"$(\"img\").attr(\"src\");","result":"test.jpg","before":"<img src=\"test.jpg\"/>"}],"cat":"DOM"},{"short":"Set a hash of key/value object properties to all matched elements.","params":[{"type":"Hash","desc":"A set of key/value pairs to set as object properties.","name":"prop"}],"desc":"Set a hash of key/value object properties to all matched elements.\nThis serves as the best way to set a large number of properties\non all matched elements.","tests":["var pass = true;\n$(\"div\").attr({foo: 'baz', zoo: 'ping'}).each(function(){\n  if ( this.getAttribute('foo') != \"baz\" && this.getAttribute('zoo') != \"ping\" ) pass = false;\n});\nok( pass, \"Set Multiple Attributes\" );"],"type":"jQuery","name":"attr","examples":[{"code":"$(\"img\").attr({ src: \"test.jpg\", alt: \"Test Image\" });","result":"<img src=\"test.jpg\" alt=\"Test Image\"/>","before":"<img/>"}],"cat":"DOM"},{"short":"Set a single property to a value, on all matched elements.","params":[{"type":"String","desc":"The name of the property to set.","name":"key"},{"type":"Object","desc":"The value to set the property to.","name":"value"}],"desc":"Set a single property to a value, on all matched elements.","tests":["var div = $(\"div\");\ndiv.attr(\"foo\", \"bar\");\nvar pass = true;\nfor ( var i = 0; i < div.size(); i++ ) {\n  if ( div.get(i).getAttribute('foo') != \"bar\" ) pass = false;\n}\nok( pass, \"Set Attribute\" );\n\n$(\"#name\").attr('name', 'something');\nok( $(\"#name\").name() == 'something', 'Set name attribute' );\n$(\"#check2\").attr('checked', true);\nok( document.getElementById('check2').checked == true, 'Set checked attribute' );\n$(\"#check2\").attr('checked', false);\nok( document.getElementById('check2').checked == false, 'Set checked attribute' );"],"type":"jQuery","name":"attr","examples":[{"code":"$(\"img\").attr(\"src\",\"test.jpg\");","result":"<img src=\"test.jpg\"/>","before":"<img/>"}],"cat":"DOM"},{"short":"Access a style property on the first matched element.","params":[{"type":"String","desc":"The name of the property to access.","name":"name"}],"desc":"Access a style property on the first matched element.\nThis method makes it easy to retrieve a style property value\nfrom the first matched element.","tests":["ok( $('#main').css(\"display\") == 'none', 'Check for css property \"display\"');"],"type":"Object","name":"css","examples":[{"desc":"Retrieves the color style of the first paragraph","before":"<p style=\"color:red;\">Test Paragraph.</p>","code":"$(\"p\").css(\"color\");","result":"red"},{"desc":"Retrieves the font-weight style of the first paragraph.\nNote that for all style properties with a dash (like 'font-weight'), you have to\nwrite it in camelCase. In other words: Every time you have a '-' in a \nproperty, remove it and replace the next character with an uppercase \nrepresentation of itself. Eg. fontWeight, fontSize, fontFamily, borderWidth,\nborderStyle, borderBottomWidth etc.","before":"<p style=\"font-weight: bold;\">Test Paragraph.</p>","code":"$(\"p\").css(\"fontWeight\");","result":"bold"}],"cat":"CSS"},{"short":"Set a hash of key/value style properties to all matched elements.","params":[{"type":"Hash","desc":"A set of key/value pairs to set as style properties.","name":"prop"}],"desc":"Set a hash of key/value style properties to all matched elements.\nThis serves as the best way to set a large number of style properties\non all matched elements.","tests":["ok( $('#foo').is(':visible'), 'Modifying CSS display: Assert element is visible');\n$('#foo').css({display: 'none'});\nok( !$('#foo').is(':visible'), 'Modified CSS display: Assert element is hidden');\n$('#foo').css({display: 'block'});\nok( $('#foo').is(':visible'), 'Modified CSS display: Assert element is visible');"],"type":"jQuery","name":"css","examples":[{"code":"$(\"p\").css({ color: \"red\", background: \"blue\" });","result":"<p style=\"color:red; background:blue;\">Test Paragraph.</p>","before":"<p>Test Paragraph.</p>"}],"cat":"CSS"},{"short":"Set a single style property to a value, on all matched elements.","params":[{"type":"String","desc":"The name of the property to set.","name":"key"},{"type":"Object","desc":"The value to set the property to.","name":"value"}],"desc":"Set a single style property to a value, on all matched elements.","tests":["ok( $('#foo').is(':visible'), 'Modifying CSS display: Assert element is visible');\n$('#foo').css('display', 'none');\nok( !$('#foo').is(':visible'), 'Modified CSS display: Assert element is hidden');\n$('#foo').css('display', 'block');\nok( $('#foo').is(':visible'), 'Modified CSS display: Assert element is visible');"],"type":"jQuery","name":"css","examples":[{"desc":"Changes the color of all paragraphs to red","before":"<p>Test Paragraph.</p>","code":"$(\"p\").css(\"color\",\"red\");","result":"<p style=\"color:red;\">Test Paragraph.</p>"}],"cat":"CSS"},{"short":"Retrieve the text contents of all matched elements.","params":[],"desc":"Retrieve the text contents of all matched elements. The result is\na string that contains the combined text contents of all matched\nelements. This method works on both HTML and XML documents.","tests":["var expected = \"This link has class=\\\"blog\\\": Simon Willison's Weblog\";\nok( $('#sap').text() == expected, 'Check for merged text of more then one element.' );"],"type":"String","name":"text","examples":[{"code":"$(\"p\").text();","result":"Test Paragraph.","before":"<p>Test Paragraph.</p>"}],"cat":"DOM"},{"short":"Wrap all matched elements with a structure of other elements.","params":[{"type":"String","desc":"A string of HTML, that will be created on the fly and wrapped around the target.","name":"html"}],"desc":"Wrap all matched elements with a structure of other elements.\nThis wrapping process is most useful for injecting additional\nstucture into a document, without ruining the original semantic\nqualities of a document.\n\nThis works by going through the first element\nprovided (which is generated, on the fly, from the provided HTML)\nand finds the deepest ancestor element within its\nstructure - it is that element that will en-wrap everything else.\n\nThis does not work with elements that contain text. Any necessary text\nmust be added after the wrapping is done.","tests":["var defaultText = 'Try them out:'\nvar result = $('#first').wrap('<div class=\"red\"><span></span></div>').text();\nok( defaultText == result, 'Check for wrapping of on-the-fly html' );\nok( $('#first').parent().parent().is('.red'), 'Check if wrapper has class \"red\"' );"],"type":"jQuery","name":"wrap","examples":[{"code":"$(\"p\").wrap(\"<div class='wrap'></div>\");","result":"<div class='wrap'><p>Test Paragraph.</p></div>","before":"<p>Test Paragraph.</p>"}],"cat":"DOM/Manipulation"},{"short":"Wrap all matched elements with a structure of other elements.","params":[{"type":"Element","desc":"A DOM element that will be wrapped.","name":"elem"}],"desc":"Wrap all matched elements with a structure of other elements.\nThis wrapping process is most useful for injecting additional\nstucture into a document, without ruining the original semantic\nqualities of a document.\n\nThis works by going through the first element\nprovided and finding the deepest ancestor element within its\nstructure - it is that element that will en-wrap everything else.\n\nThis does not work with elements that contain text. Any necessary text\nmust be added after the wrapping is done.","tests":["var defaultText = 'Try them out:'\nvar result = $('#first').wrap(document.getElementById('empty')).parent();\nok( result.is('ol'), 'Check for element wrapping' );\nok( result.text() == defaultText, 'Check for element wrapping' );"],"type":"jQuery","name":"wrap","examples":[{"code":"$(\"p\").wrap( document.getElementById('content') );","result":"<div id=\"content\"><p>Test Paragraph.</p></div>","before":"<p>Test Paragraph.</p><div id=\"content\"></div>"}],"cat":"DOM/Manipulation"},{"short":"Append any number of elements to the inside of every matched elements,\ngenerated from the provided HTML.","params":[{"type":"String","desc":"A string of HTML, that will be created on the fly and appended to the target.","name":"html"}],"desc":"Append any number of elements to the inside of every matched elements,\ngenerated from the provided HTML.\nThis operation is similar to doing an appendChild to all the\nspecified elements, adding them into the document.","tests":["var defaultText = 'Try them out:'\nvar result = $('#first').append('<b>buga</b>');\nok( result.text() == defaultText + 'buga', 'Check if text appending works' );"],"type":"jQuery","name":"append","examples":[{"code":"$(\"p\").append(\"<b>Hello</b>\");","result":"<p>I would like to say: <b>Hello</b></p>","before":"<p>I would like to say: </p>"}],"cat":"DOM/Manipulation"},{"short":"Append an element to the inside of all matched elements.","params":[{"type":"Element","desc":"A DOM element that will be appended.","name":"elem"}],"desc":"Append an element to the inside of all matched elements.\nThis operation is similar to doing an appendChild to all the\nspecified elements, adding them into the document.","tests":["var expected = \"This link has class=\\\"blog\\\": Simon Willison's WeblogTry them out:\";\n$('#sap').append(document.getElementById('first'));\nok( expected == $('#sap').text(), \"Check for appending of element\" );"],"type":"jQuery","name":"append","examples":[{"code":"$(\"p\").append( $(\"#foo\")[0] );","result":"<p>I would like to say: <b id=\"foo\">Hello</b></p>","before":"<p>I would like to say: </p><b id=\"foo\">Hello</b>"}],"cat":"DOM/Manipulation"},{"short":"Append any number of elements to the inside of all matched elements.","params":[{"type":"Array<Element>","desc":"An array of elements, all of which will be appended.","name":"elems"}],"desc":"Append any number of elements to the inside of all matched elements.\nThis operation is similar to doing an appendChild to all the\nspecified elements, adding them into the document.","tests":["var expected = \"This link has class=\\\"blog\\\": Simon Willison's WeblogTry them out:Yahoo\";\n$('#sap').append([document.getElementById('first'), document.getElementById('yahoo')]);\nok( expected == $('#sap').text(), \"Check for appending of array of elements\" );"],"type":"jQuery","name":"append","examples":[{"code":"$(\"p\").append( $(\"b\") );","result":"<p>I would like to say: <b>Hello</b></p>","before":"<p>I would like to say: </p><b>Hello</b>"}],"cat":"DOM/Manipulation"},{"short":"Prepend any number of elements to the inside of every matched elements,\ngenerated from the provided HTML.","params":[{"type":"String","desc":"A string of HTML, that will be created on the fly and appended to the target.","name":"html"}],"desc":"Prepend any number of elements to the inside of every matched elements,\ngenerated from the provided HTML.\nThis operation is the best way to insert dynamically created elements\ninside, at the beginning, of all the matched element.","tests":["var defaultText = 'Try them out:'\nvar result = $('#first').prepend('<b>buga</b>');\nok( result.text() == 'buga' + defaultText, 'Check if text prepending works' );"],"type":"jQuery","name":"prepend","examples":[{"code":"$(\"p\").prepend(\"<b>Hello</b>\");","result":"<p><b>Hello</b>I would like to say: </p>","before":"<p>I would like to say: </p>"}],"cat":"DOM/Manipulation"},{"short":"Prepend an element to the inside of all matched elements.","params":[{"type":"Element","desc":"A DOM element that will be appended.","name":"elem"}],"desc":"Prepend an element to the inside of all matched elements.\nThis operation is the best way to insert an element inside, at the\nbeginning, of all the matched element.","tests":["var expected = \"Try them out:This link has class=\\\"blog\\\": Simon Willison's Weblog\";\n$('#sap').prepend(document.getElementById('first'));\nok( expected == $('#sap').text(), \"Check for prepending of element\" );"],"type":"jQuery","name":"prepend","examples":[{"code":"$(\"p\").prepend( $(\"#foo\")[0] );","result":"<p><b id=\"foo\">Hello</b>I would like to say: </p>","before":"<p>I would like to say: </p><b id=\"foo\">Hello</b>"}],"cat":"DOM/Manipulation"},{"short":"Prepend any number of elements to the inside of all matched elements.","params":[{"type":"Array<Element>","desc":"An array of elements, all of which will be appended.","name":"elems"}],"desc":"Prepend any number of elements to the inside of all matched elements.\nThis operation is the best way to insert a set of elements inside, at the\nbeginning, of all the matched element.","tests":["var expected = \"Try them out:YahooThis link has class=\\\"blog\\\": Simon Willison's Weblog\";\n$('#sap').prepend([document.getElementById('first'), document.getElementById('yahoo')]);\nok( expected == $('#sap').text(), \"Check for prepending of array of elements\" );"],"type":"jQuery","name":"prepend","examples":[{"code":"$(\"p\").prepend( $(\"b\") );","result":"<p><b>Hello</b>I would like to say: </p>","before":"<p>I would like to say: </p><b>Hello</b>"}],"cat":"DOM/Manipulation"},{"short":"Insert any number of dynamically generated elements before each of the\nmatched elements.","params":[{"type":"String","desc":"A string of HTML, that will be created on the fly and appended to the target.","name":"html"}],"desc":"Insert any number of dynamically generated elements before each of the\nmatched elements.","tests":["var expected = 'This is a normal link: bugaYahoo';\n$('#yahoo').before('<b>buga</b>');\nok( expected == $('#en').text(), 'Insert String before' );"],"type":"jQuery","name":"before","examples":[{"code":"$(\"p\").before(\"<b>Hello</b>\");","result":"<b>Hello</b><p>I would like to say: </p>","before":"<p>I would like to say: </p>"}],"cat":"DOM/Manipulation"},{"short":"Insert an element before each of the matched elements.","params":[{"type":"Element","desc":"A DOM element that will be appended.","name":"elem"}],"desc":"Insert an element before each of the matched elements.","tests":["var expected = \"This is a normal link: Try them out:Yahoo\";\n$('#yahoo').before(document.getElementById('first'));\nok( expected == $('#en').text(), \"Insert element before\" );"],"type":"jQuery","name":"before","examples":[{"code":"$(\"p\").before( $(\"#foo\")[0] );","result":"<b id=\"foo\">Hello</b><p>I would like to say: </p>","before":"<p>I would like to say: </p><b id=\"foo\">Hello</b>"}],"cat":"DOM/Manipulation"},{"short":"Insert any number of elements before each of the matched elements.","params":[{"type":"Array<Element>","desc":"An array of elements, all of which will be appended.","name":"elems"}],"desc":"Insert any number of elements before each of the matched elements.","tests":["var expected = \"This is a normal link: Try them out:diveintomarkYahoo\";\n$('#yahoo').before([document.getElementById('first'), document.getElementById('mark')]);\nok( expected == $('#en').text(), \"Insert array of elements before\" );"],"type":"jQuery","name":"before","examples":[{"code":"$(\"p\").before( $(\"b\") );","result":"<b>Hello</b><p>I would like to say: </p>","before":"<p>I would like to say: </p><b>Hello</b>"}],"cat":"DOM/Manipulation"},{"short":"Insert any number of dynamically generated elements after each of the\nmatched elements.","params":[{"type":"String","desc":"A string of HTML, that will be created on the fly and appended to the target.","name":"html"}],"desc":"Insert any number of dynamically generated elements after each of the\nmatched elements.","tests":["var expected = 'This is a normal link: Yahoobuga';\n$('#yahoo').after('<b>buga</b>');\nok( expected == $('#en').text(), 'Insert String after' );"],"type":"jQuery","name":"after","examples":[{"code":"$(\"p\").after(\"<b>Hello</b>\");","result":"<p>I would like to say: </p><b>Hello</b>","before":"<p>I would like to say: </p>"}],"cat":"DOM/Manipulation"},{"short":"Insert an element after each of the matched elements.","params":[{"type":"Element","desc":"A DOM element that will be appended.","name":"elem"}],"desc":"Insert an element after each of the matched elements.","tests":["var expected = \"This is a normal link: YahooTry them out:\";\n$('#yahoo').after(document.getElementById('first'));\nok( expected == $('#en').text(), \"Insert element after\" );"],"type":"jQuery","name":"after","examples":[{"code":"$(\"p\").after( $(\"#foo\")[0] );","result":"<p>I would like to say: </p><b id=\"foo\">Hello</b>","before":"<b id=\"foo\">Hello</b><p>I would like to say: </p>"}],"cat":"DOM/Manipulation"},{"short":"Insert any number of elements after each of the matched elements.","params":[{"type":"Array<Element>","desc":"An array of elements, all of which will be appended.","name":"elems"}],"desc":"Insert any number of elements after each of the matched elements.","tests":["var expected = \"This is a normal link: YahooTry them out:diveintomark\";\n$('#yahoo').after([document.getElementById('first'), document.getElementById('mark')]);\nok( expected == $('#en').text(), \"Insert array of elements after\" );"],"type":"jQuery","name":"after","examples":[{"code":"$(\"p\").after( $(\"b\") );","result":"<p>I would like to say: </p><b>Hello</b>","before":"<b>Hello</b><p>I would like to say: </p>"}],"cat":"DOM/Manipulation"},{"short":"End the most recent 'destructive' operation, reverting the list of matched elements\nback to its previous state.","params":[],"desc":"End the most recent 'destructive' operation, reverting the list of matched elements\nback to its previous state. After an end operation, the list of matched elements will\nrevert to the last state of matched elements.","tests":["ok( 'Yahoo' == $('#yahoo').parent().end().text(), 'Check for end' );"],"type":"jQuery","name":"end","examples":[{"code":"$(\"p\").find(\"span\").end();","result":"$(\"p\").find(\"span\").end() == [ <p>...</p> ]","before":"<p><span>Hello</span>, how are you?</p>"}],"cat":"DOM/Traversing"},{"short":"Searches for all elements that match the specified expression.","params":[{"type":"String","desc":"An expression to search with.","name":"expr"}],"desc":"Searches for all elements that match the specified expression.\nThis method is the optimal way of finding additional descendant\nelements with which to process.\n\nAll searching is done using a jQuery expression. The expression can be\nwritten using CSS 1-3 Selector syntax, or basic XPath.","tests":["ok( 'Yahoo' == $('#foo').find('.blogTest').text(), 'Check for find' );"],"type":"jQuery","name":"find","examples":[{"code":"$(\"p\").find(\"span\");","result":"$(\"p\").find(\"span\") == [ <span>Hello</span> ]","before":"<p><span>Hello</span>, how are you?</p>"}],"cat":"DOM/Traversing"},{"short":"Create cloned copies of all matched DOM Elements.","params":[],"desc":"Create cloned copies of all matched DOM Elements. This does\nnot create a cloned copy of this particular jQuery object,\ninstead it creates duplicate copies of all DOM Elements.\nThis is useful for moving copies of the elements to another\nlocation in the DOM.","tests":["ok( 'This is a normal link: Yahoo' == $('#en').text(), 'Assert text for #en' );\nvar clone = $('#yahoo').clone();\nok( 'Try them out:Yahoo' == $('#first').append(clone).text(), 'Check for clone' );\nok( 'This is a normal link: Yahoo' == $('#en').text(), 'Reassert text for #en' );"],"type":"jQuery","name":"clone","examples":[{"code":"$(\"b\").clone().prependTo(\"p\");","result":"<b>Hello</b><p><b>Hello</b>, how are you?</p>","before":"<b>Hello</b><p>, how are you?</p>"}],"cat":"DOM/Manipulation"},{"short":"Removes all elements from the set of matched elements that do not\nmatch the specified expression.","params":[{"type":"String","desc":"An expression to search with.","name":"expr"}],"desc":"Removes all elements from the set of matched elements that do not\nmatch the specified expression. This method is used to narrow down\nthe results of a search.\n\nAll searching is done using a jQuery expression. The expression\ncan be written using CSS 1-3 Selector syntax, or basic XPath.","tests":["isSet( $(\"input\").filter(\":checked\").get(), q(\"radio2\", \"check1\"), \"Filter elements\" );","$(\"input\").filter(\":checked\",function(i){ \n  ok( this == q(\"radio2\", \"check1\")[i], \"Filter elements, context\" );\n});","$(\"#main > p#ap > a\").filter(\"#foobar\",function(){},function(i){\n  ok( this == q(\"google\",\"groups\", \"mark\")[i], \"Filter elements, else context\" );\n});"],"type":"jQuery","name":"filter","examples":[{"code":"$(\"p\").filter(\".selected\")","result":"$(\"p\").filter(\".selected\") == [ <p class=\"selected\">Hello</p> ]","before":"<p class=\"selected\">Hello</p><p>How are you?</p>"}],"cat":"DOM/Traversing"},{"short":"Removes all elements from the set of matched elements that do not\nmatch at least one of the expressions passed to the function.","params":[{"type":"Array<String>","desc":"A set of expressions to evaluate against","name":"exprs"}],"desc":"Removes all elements from the set of matched elements that do not\nmatch at least one of the expressions passed to the function. This\nmethod is used when you want to filter the set of matched elements\nthrough more than one expression.\n\nElements will be retained in the jQuery object if they match at\nleast one of the expressions passed.","tests":[],"type":"jQuery","name":"filter","examples":[{"code":"$(\"p\").filter([\".selected\", \":first\"])","result":"$(\"p\").filter([\".selected\", \":first\"]) == [ <p>Hello</p>, <p class=\"selected\">And Again</p> ]","before":"<p>Hello</p><p>Hello Again</p><p class=\"selected\">And Again</p>"}],"cat":"DOM/Traversing"},{"short":"Removes the specified Element from the set of matched elements.","params":[{"type":"Element","desc":"An element to remove from the set","name":"el"}],"desc":"Removes the specified Element from the set of matched elements. This\nmethod is used to remove a single Element from a jQuery object.","tests":[],"type":"jQuery","name":"not","examples":[{"code":"$(\"p\").not( document.getElementById(\"selected\") )","result":"[ <p>Hello</p> ]","before":"<p>Hello</p><p id=\"selected\">Hello Again</p>"}],"cat":"DOM/Traversing"},{"short":"Removes elements matching the specified expression from the set\nof matched elements.","params":[{"type":"String","desc":"An expression with which to remove matching elements","name":"expr"}],"desc":"Removes elements matching the specified expression from the set\nof matched elements. This method is used to remove one or more\nelements from a jQuery object.","tests":["ok($(\"#main > p#ap > a\").not(\"#google\").length == 2, \".not\")"],"type":"jQuery","name":"not","examples":[{"code":"$(\"p\").not(\"#selected\")","result":"[ <p>Hello</p> ]","before":"<p>Hello</p><p id=\"selected\">Hello Again</p>"}],"cat":"DOM/Traversing"},{"short":"Adds the elements matched by the expression to the jQuery object.","params":[{"type":"String","desc":"An expression whose matched elements are added","name":"expr"}],"desc":"Adds the elements matched by the expression to the jQuery object. This\ncan be used to concatenate the result sets of two expressions.","tests":[],"type":"jQuery","name":"add","examples":[{"code":"$(\"p\").add(\"span\")","result":"[ <p>Hello</p>, <span>Hello Again</span> ]","before":"<p>Hello</p><p><span>Hello Again</span></p>"}],"cat":"DOM/Traversing"},{"short":"Adds each of the Elements in the array to the set of matched elements.","params":[{"type":"Array<Element>","desc":"An array of Elements to add","name":"els"}],"desc":"Adds each of the Elements in the array to the set of matched elements.\nThis is used to add a set of Elements to a jQuery object.","tests":[],"type":"jQuery","name":"add","examples":[{"code":"$(\"p\").add([document.getElementById(\"a\"), document.getElementById(\"b\")])","result":"[ <p>Hello</p>, <span id=\"a\">Hello Again</span>, <span id=\"b\">And Again</span> ]","before":"<p>Hello</p><p><span id=\"a\">Hello Again</span><span id=\"b\">And Again</span></p>"}],"cat":"DOM/Traversing"},{"short":"Adds a single Element to the set of matched elements.","params":[{"type":"Element","desc":"An Element to add","name":"el"}],"desc":"Adds a single Element to the set of matched elements. This is used to\nadd a single Element to a jQuery object.","tests":[],"type":"jQuery","name":"add","examples":[{"code":"$(\"p\").add( document.getElementById(\"a\") )","result":"[ <p>Hello</p>, <span id=\"a\">Hello Again</span> ]","before":"<p>Hello</p><p><span id=\"a\">Hello Again</span></p>"}],"cat":"DOM/Traversing"},{"short":"Checks the current selection against an expression and returns true,\nif the selection fits the given expression.","params":[{"type":"String","desc":"The expression with which to filter","name":"expr"}],"desc":"Checks the current selection against an expression and returns true,\nif the selection fits the given expression. Does return false, if the\nselection does not fit or the expression is not valid.","tests":["ok( $('#form').is('form'), 'Check for element: A form must be a form' );\nok( !$('#form').is('div'), 'Check for element: A form is not a div' );\nok( $('#mark').is('.blog'), 'Check for class: Expected class \"blog\"' );\nok( !$('#mark').is('.link'), 'Check for class: Did not expect class \"link\"' );\nok( $('#simon').is('.blog.link'), 'Check for multiple classes: Expected classes \"blog\" and \"link\"' );\nok( !$('#simon').is('.blogTest'), 'Check for multiple classes: Expected classes \"blog\" and \"link\", but not \"blogTest\"' );\nok( $('#en').is('[@lang=\"en\"]'), 'Check for attribute: Expected attribute lang to be \"en\"' );\nok( !$('#en').is('[@lang=\"de\"]'), 'Check for attribute: Expected attribute lang to be \"en\", not \"de\"' );\nok( $('#text1').is('[@type=\"text\"]'), 'Check for attribute: Expected attribute type to be \"text\"' );\nok( !$('#text1').is('[@type=\"radio\"]'), 'Check for attribute: Expected attribute type to be \"text\", not \"radio\"' );\nok( $('#text2').is(':disabled'), 'Check for pseudoclass: Expected to be disabled' );\nok( !$('#text1').is(':disabled'), 'Check for pseudoclass: Expected not disabled' );\nok( $('#radio2').is(':checked'), 'Check for pseudoclass: Expected to be checked' );\nok( !$('#radio1').is(':checked'), 'Check for pseudoclass: Expected not checked' );\nok( $('#foo').is('[p]'), 'Check for child: Expected a child \"p\" element' );\nok( !$('#foo').is('[ul]'), 'Check for child: Did not expect \"ul\" element' );\nok( $('#foo').is('[p][a][code]'), 'Check for childs: Expected \"p\", \"a\" and \"code\" child elements' );\nok( !$('#foo').is('[p][a][code][ol]'), 'Check for childs: Expected \"p\", \"a\" and \"code\" child elements, but no \"ol\"' );\nok( !$('#foo').is(0), 'Expected false for an invalid expression - 0' );\nok( !$('#foo').is(null), 'Expected false for an invalid expression - null' );\nok( !$('#foo').is(''), 'Expected false for an invalid expression - \"\"' );\nok( !$('#foo').is(undefined), 'Expected false for an invalid expression - undefined' );"],"type":"Boolean","name":"is","examples":[{"desc":"Returns true, because the parent of the input is a form element","before":"<form><input type=\"checkbox\" /></form>","code":"$(\"input[@type='checkbox']\").parent().is(\"form\")","result":"true"},{"desc":"Returns false, because the parent of the input is a p element","before":"<form><p><input type=\"checkbox\" /></p></form>","code":"$(\"input[@type='checkbox']\").parent().is(\"form\")","result":"false"},{"desc":"An invalid expression always returns false.","before":"<form></form>","code":"$(\"form\").is(null)","result":"false"}],"cat":"DOM/Traversing"},{"cat":"Core","type":"jQuery","desc":"","params":[{"type":"Array","desc":"","name":"args"},{"type":"Boolean","desc":"","name":"table"},{"type":"Number","desc":"","name":"int"},{"type":"Function","desc":"The function doing the DOM manipulation.","name":"fn"}],"short":"","examples":[],"tests":[],"private":1,"name":"domManip"},{"cat":"Core","type":"jQuery","desc":"","params":[{"type":"Array","desc":"","name":"a"},{"type":"Array","desc":"","name":"args"}],"short":"","examples":[],"tests":[],"private":1,"name":"pushStack"},{"cat":"Core","type":"Object","desc":"Extends the jQuery object itself. Can be used to add both static\nfunctions and plugin methods.","params":[{"type":"Object","desc":"","name":"obj"}],"short":"Extends the jQuery object itself.","examples":[{"desc":"Adds two plugin methods.","code":"$.fn.extend({\n  check: function() {\n    this.each(function() { this.checked = true; });\n  ),\n  uncheck: function() {\n    this.each(function() { this.checked = false; });\n  }\n});\n$(\"input[@type=checkbox]\").check();\n$(\"input[@type=radio]\").uncheck();"}],"tests":[],"private":1,"name":"extend"},{"short":"Extend one object with another, returning the original,\nmodified, object.","params":[{"type":"Object","desc":"The object to extend","name":"obj"},{"type":"Object","desc":"The object that will be merged into the first.","name":"prop"}],"desc":"Extend one object with another, returning the original,\nmodified, object. This is a great utility for simple inheritance.","tests":["var settings = { xnumber1: 5, xnumber2: 7, xstring1: \"peter\", xstring2: \"pan\" };\nvar options =     { xnumber2: 1, xstring2: \"x\", xxx: \"newstring\" };\nvar optionsCopy = { xnumber2: 1, xstring2: \"x\", xxx: \"newstring\" };\nvar merged = { xnumber1: 5, xnumber2: 1, xstring1: \"peter\", xstring2: \"x\", xxx: \"newstring\" };\njQuery.extend(settings, options);\nisSet( settings, merged, \"Check if extended: settings must be extended\" );\nisSet ( options, optionsCopy, \"Check if not modified: options must not be modified\" );"],"type":"Object","name":"$.extend","examples":[{"code":"var settings = { validate: false, limit: 5, name: \"foo\" };\nvar options = { validate: true, name: \"bar\" };\njQuery.extend(settings, options);","result":"settings == { validate: true, limit: 5, name: \"bar\" }"}],"cat":"Javascript"},{"cat":"Core","type":"undefined","desc":"","params":[],"short":"","examples":[],"tests":[],"private":1,"name":"init"},{"short":"A generic iterator function, which can be used to seemlessly\niterate over both objects and arrays.","params":[{"type":"Object","desc":"The object, or array, to iterate over.","name":"obj"},{"type":"Function","desc":"The function that will be executed on every object.","name":"fn"}],"desc":"A generic iterator function, which can be used to seemlessly\niterate over both objects and arrays. This function is not the same\nas $().each() - which is used to iterate, exclusively, over a jQuery\nobject. This function can be used to iterate over anything.","tests":[],"type":"Object","name":"$.each","examples":[{"desc":"This is an example of iterating over the items in an array, accessing both the current item and its index.","code":"$.each( [0,1,2], function(i){\n  alert( \"Item #\" + i + \": \" + this );\n});"},{"desc":"This is an example of iterating over the properties in an Object, accessing both the current item and its key.","code":"$.each( { name: \"John\", lang: \"JS\" }, function(i){\n  alert( \"Name: \" + i + \", Value: \" + this );\n});"}],"cat":"Javascript"},{"cat":"Core","type":"Array<Element>","desc":"","params":[],"short":"","examples":[],"tests":["t( \"Element Selector\", \"div\", [\"main\",\"foo\"] );\nt( \"Element Selector\", \"body\", [\"body\"] );\nt( \"Element Selector\", \"html\", [\"html\"] );\nok( $(\"*\").size() >= 30, \"Element Selector\" );\nt( \"Parent Element\", \"div div\", [\"foo\"] );\n\nt( \"ID Selector\", \"#body\", [\"body\"] );\nt( \"ID Selector w/ Element\", \"body#body\", [\"body\"] );\nt( \"ID Selector w/ Element\", \"ul#first\", [] );\n\nt( \"Class Selector\", \".blog\", [\"mark\",\"simon\"] );\nt( \"Class Selector\", \".blog.link\", [\"simon\"] );\nt( \"Class Selector w/ Element\", \"a.blog\", [\"mark\",\"simon\"] );\nt( \"Parent Class Selector\", \"p .blog\", [\"mark\",\"simon\"] );\n\nt( \"Comma Support\", \"a.blog, div\", [\"mark\",\"simon\",\"main\",\"foo\"] );\nt( \"Comma Support\", \"a.blog , div\", [\"mark\",\"simon\",\"main\",\"foo\"] );\nt( \"Comma Support\", \"a.blog ,div\", [\"mark\",\"simon\",\"main\",\"foo\"] );\nt( \"Comma Support\", \"a.blog,div\", [\"mark\",\"simon\",\"main\",\"foo\"] );\n\nt( \"Child\", \"p > a\", [\"simon1\",\"google\",\"groups\",\"mark\",\"yahoo\",\"simon\"] );\nt( \"Child\", \"p> a\", [\"simon1\",\"google\",\"groups\",\"mark\",\"yahoo\",\"simon\"] );\nt( \"Child\", \"p >a\", [\"simon1\",\"google\",\"groups\",\"mark\",\"yahoo\",\"simon\"] );\nt( \"Child\", \"p>a\", [\"simon1\",\"google\",\"groups\",\"mark\",\"yahoo\",\"simon\"] );\nt( \"Child w/ Class\", \"p > a.blog\", [\"mark\",\"simon\"] );\nt( \"All Children\", \"code > *\", [\"anchor1\",\"anchor2\"] );\nt( \"All Grandchildren\", \"p > * > *\", [\"anchor1\",\"anchor2\"] );\nt( \"Adjacent\", \"a + a\", [\"groups\"] );\nt( \"Adjacent\", \"a +a\", [\"groups\"] );\nt( \"Adjacent\", \"a+ a\", [\"groups\"] );\nt( \"Adjacent\", \"a+a\", [\"groups\"] );\nt( \"Adjacent\", \"p + p\", [\"ap\",\"en\",\"sap\"] );\nt( \"Comma, Child, and Adjacent\", \"a + a, code > a\", [\"groups\",\"anchor1\",\"anchor2\"] );\nt( \"First Child\", \"p:first-child\", [\"firstp\",\"sndp\"] );\nt( \"Attribute Exists\", \"a[@title]\", [\"google\"] );\nt( \"Attribute Exists\", \"*[@title]\", [\"google\"] );\nt( \"Attribute Exists\", \"[@title]\", [\"google\"] );\n\nt( \"Non-existing part of attribute [@name*=bla]\", \"[@name*=bla]\", [] ); \nt( \"Non-existing start of attribute [@name^=bla]\", \"[@name^=bla]\", [] ); \nt( \"Non-existing end of attribute [@name$=bla]\", \"[@name$=bla]\", [] ); \n\nt( \"Attribute Equals\", \"a[@rel='bookmark']\", [\"simon1\"] );\nt( \"Attribute Equals\", 'a[@rel=\"bookmark\"]', [\"simon1\"] );\nt( \"Attribute Equals\", \"a[@rel=bookmark]\", [\"simon1\"] );\nt( \"Multiple Attribute Equals\", \"input[@type='hidden'],input[@type='radio']\", [\"hidden1\",\"radio1\",\"radio2\"] );\nt( \"Multiple Attribute Equals\", \"input[@type=\\\"hidden\\\"],input[@type='radio']\", [\"hidden1\",\"radio1\",\"radio2\"] );\nt( \"Multiple Attribute Equals\", \"input[@type=hidden],input[@type=radio]\", [\"hidden1\",\"radio1\",\"radio2\"] );\n\nt( \"Attribute Begins With\", \"a[@href ^= 'http://www']\", [\"google\",\"yahoo\"] );\nt( \"Attribute Ends With\", \"a[@href $= 'org/']\", [\"mark\"] );\nt( \"Attribute Contains\", \"a[@href *= 'google']\", [\"google\",\"groups\"] );\nt( \"First Child\", \"p:first-child\", [\"firstp\",\"sndp\"] );\nt( \"Last Child\", \"p:last-child\", [\"sap\"] );\nt( \"Only Child\", \"a:only-child\", [\"simon1\",\"anchor1\",\"yahoo\",\"anchor2\"] );\nt( \"Empty\", \"ul:empty\", [\"firstUL\"] );\nt( \"Enabled UI Element\", \"input:enabled\", [\"text1\",\"radio1\",\"radio2\",\"check1\",\"check2\",\"hidden1\",\"hidden2\",\"name\"] );\nt( \"Disabled UI Element\", \"input:disabled\", [\"text2\"] );\nt( \"Checked UI Element\", \"input:checked\", [\"radio2\",\"check1\"] );\nt( \"Selected Option Element\", \"option:selected\", [\"option1a\",\"option2d\",\"option3b\",\"option3c\"] );\nt( \"Text Contains\", \"a:contains('Google')\", [\"google\",\"groups\"] );\nt( \"Text Contains\", \"a:contains('Google Groups')\", [\"groups\"] );\nt( \"Element Preceded By\", \"p ~ div\", [\"foo\"] );\nt( \"Not\", \"a.blog:not(.link)\", [\"mark\"] );\n\nok( jQuery.find(\"//*\").length >= 30, \"All Elements (//*)\" );\nt( \"All Div Elements\", \"//div\", [\"main\",\"foo\"] );\nt( \"Absolute Path\", \"/html/body\", [\"body\"] );\nt( \"Absolute Path w/ *\", \"/* /body\", [\"body\"] );\nt( \"Long Absolute Path\", \"/html/body/dl/div/div/p\", [\"sndp\",\"en\",\"sap\"] );\nt( \"Absolute and Relative Paths\", \"/html//div\", [\"main\",\"foo\"] );\nt( \"All Children, Explicit\", \"//code/*\", [\"anchor1\",\"anchor2\"] );\nt( \"All Children, Implicit\", \"//code/\", [\"anchor1\",\"anchor2\"] );\nt( \"Attribute Exists\", \"//a[@title]\", [\"google\"] );\nt( \"Attribute Equals\", \"//a[@rel='bookmark']\", [\"simon1\"] );\nt( \"Parent Axis\", \"//p/..\", [\"main\",\"foo\"] );\nt( \"Sibling Axis\", \"//p/../\", [\"firstp\",\"ap\",\"foo\",\"first\",\"firstUL\",\"empty\",\"form\",\"sndp\",\"en\",\"sap\"] );\nt( \"Sibling Axis\", \"//p/../*\", [\"firstp\",\"ap\",\"foo\",\"first\",\"firstUL\",\"empty\",\"form\",\"sndp\",\"en\",\"sap\"] );\nt( \"Has Children\", \"//p[a]\", [\"firstp\",\"ap\",\"en\",\"sap\"] );\n\nt( \"nth Element\", \"p:nth(1)\", [\"ap\"] );\nt( \"First Element\", \"p:first\", [\"firstp\"] );\nt( \"Last Element\", \"p:last\", [\"first\"] );\nt( \"Even Elements\", \"p:even\", [\"firstp\",\"sndp\",\"sap\"] );\nt( \"Odd Elements\", \"p:odd\", [\"ap\",\"en\",\"first\"] );\nt( \"Position Equals\", \"p:eq(1)\", [\"ap\"] );\nt( \"Position Greater Than\", \"p:gt(0)\", [\"ap\",\"sndp\",\"en\",\"sap\",\"first\"] );\nt( \"Position Less Than\", \"p:lt(3)\", [\"firstp\",\"ap\",\"sndp\"] );\nt( \"Is A Parent\", \"p:parent\", [\"firstp\",\"ap\",\"sndp\",\"en\",\"sap\",\"first\"] );\nt( \"Is Visible\", \"input:visible\", [\"text1\",\"text2\",\"radio1\",\"radio2\",\"check1\",\"check2\",\"name\"] );\nt( \"Is Hidden\", \"input:hidden\", [\"hidden1\",\"hidden2\"] );\n\nt( \"Grouped Form Elements\", \"input[@name='foo[bar]']\", [\"hidden2\"] );\n\nt( \"All Children of ID\", \"#foo/*\", [\"sndp\", \"en\", \"sap\"]  );\nt( \"All Children of ID with no children\", \"#firstUL/*\", []  );\n\nt( \"Form element :input\", \":input\", [\"text1\", \"text2\", \"radio1\", \"radio2\", \"check1\", \"check2\", \"hidden1\", \"hidden2\", \"name\", \"button\", \"area1\", \"select1\", \"select2\", \"select3\"] );\nt( \"Form element :radio\", \":radio\", [\"radio1\", \"radio2\"] );\nt( \"Form element :checkbox\", \":checkbox\", [\"check1\", \"check2\"] );\nt( \"Form element :text\", \":text\", [\"text1\", \"text2\", \"hidden2\", \"name\"] );\nt( \"Form element :radio:checked\", \":radio:checked\", [\"radio2\"] );\nt( \"Form element :checkbox:checked\", \":checkbox:checked\", [\"check1\"] );\nt( \"Form element :checkbox:checked, :radio:checked\", \":checkbox:checked, :radio:checked\", [\"check1\", \"radio2\"] );\n\nt( \":not() Existing attribute\", \"select:not([@multiple])\", [\"select1\", \"select2\"]);\nt( \":not() Equals attribute\", \"select:not([@name=select1])\", [\"select2\", \"select3\"]);\nt( \":not() Equals quoted attribute\", \"select:not([@name='select1'])\", [\"select2\", \"select3\"]);"],"private":1,"name":"$.find"},{"short":"Remove the whitespace from the beginning and end of a string.","params":[{"type":"String","desc":"The string to trim.","name":"str"}],"desc":"Remove the whitespace from the beginning and end of a string.","tests":[],"type":"String","name":"$.trim","examples":[{"code":"$.trim(\"  hello, how are you?  \");","result":"\"hello, how are you?\""}],"cat":"Javascript"},{"cat":"DOM/Traversing","type":"Array<Element>","desc":"All ancestors of a given element.","params":[{"type":"Element","desc":"The element to find the ancestors of.","name":"elem"}],"short":"All ancestors of a given element.","examples":[],"tests":[],"private":1,"name":"$.parents"},{"cat":"DOM/Traversing","type":"Array","desc":"All elements on a specified axis.","params":[{"type":"Element","desc":"The element to find all the siblings of (including itself).","name":"elem"}],"short":"All elements on a specified axis.","examples":[],"tests":[],"private":1,"name":"$.sibling"},{"short":"Merge two arrays together, removing all duplicates.","params":[{"type":"Array","desc":"The first array to merge.","name":"first"},{"type":"Array","desc":"The second array to merge.","name":"second"}],"desc":"Merge two arrays together, removing all duplicates. The final order\nor the new array is: All the results from the first array, followed\nby the unique results from the second array.","tests":[],"type":"Array","name":"$.merge","examples":[{"code":"$.merge( [0,1,2], [2,3,4] )","result":"[0,1,2,3,4]"},{"code":"$.merge( [3,2,1], [4,3,2] )","result":"[3,2,1,4]"}],"cat":"Javascript"},{"short":"Filter items out of an array, by using a filter function.","params":[{"type":"Array","desc":"The Array to find items in.","name":"array"},{"type":"Function","desc":"The function to process each item against.","name":"fn"},{"type":"Boolean","desc":"Invert the selection - select the opposite of the function.","name":"inv"}],"desc":"Filter items out of an array, by using a filter function.\nThe specified function will be passed two arguments: The\ncurrent array item and the index of the item in the array. The\nfunction should return 'true' if you wish to keep the item in\nthe array, false if it should be removed.","tests":[],"type":"Array","name":"$.grep","examples":[{"code":"$.grep( [0,1,2], function(i){\n  return i > 0;\n});","result":"[1, 2]"}],"cat":"Javascript"},{"short":"Translate all items in an array to another array of items.","params":[{"type":"Array","desc":"The Array to translate.","name":"array"},{"type":"Function","desc":"The function to process each item against.","name":"fn"}],"desc":"Translate all items in an array to another array of items. \nThe translation function that is provided to this method is \ncalled for each item in the array and is passed one argument: \nThe item to be translated. The function can then return:\nThe translated value, 'null' (to remove the item), or \nan array of values - which will be flattened into the full array.","tests":[],"type":"Array","name":"$.map","examples":[{"code":"$.map( [0,1,2], function(i){\n  return i + 4;\n});","result":"[4, 5, 6]"},{"code":"$.map( [0,1,2], function(i){\n  return i > 0 ? i + 1 : null;\n});","result":"[2, 3]"},{"code":"$.map( [0,1,2], function(i){\n  return [ i, i + 1 ];\n});","result":"[0, 1, 1, 2, 2, 3]"}],"cat":"Javascript"},{"short":"Contains flags for the useragent, read from navigator.","params":[],"desc":"Contains flags for the useragent, read from navigator.userAgent.\nAvailable flags are: safari, opera, msie, mozilla\nThis property is available before the DOM is ready, therefore you can\nuse it to add ready events only for certain browsers.\n\nSee <a href=\"http://davecardwell.co.uk/geekery/javascript/jquery/jqbrowser/\">\njQBrowser plugin</a> for advanced browser detection:","tests":[],"type":"Boolean","name":"$.browser","examples":[{"desc":"returns true if the current useragent is some version of microsoft's internet explorer","code":"$.browser.msie"},{"desc":"Alerts \"this is safari!\" only for safari browsers","code":"if($.browser.safari) { $( function() { alert(\"this is safari!\"); } ); }"}],"cat":"Javascript"},{"short":"Append all of the matched elements to another, specified, set of elements.","params":[{"type":"String","desc":"A jQuery expression of elements to match.","name":"expr"}],"desc":"Append all of the matched elements to another, specified, set of elements.\nThis operation is, essentially, the reverse of doing a regular\n$(A).append(B), in that instead of appending B to A, you're appending\nA to B.","tests":[],"type":"jQuery","name":"appendTo","examples":[{"code":"$(\"p\").appendTo(\"#foo\");","result":"<div id=\"foo\"><p>I would like to say: </p></div>","before":"<p>I would like to say: </p><div id=\"foo\"></div>"}],"cat":"DOM/Manipulation"},{"short":"Prepend all of the matched elements to another, specified, set of elements.","params":[{"type":"String","desc":"A jQuery expression of elements to match.","name":"expr"}],"desc":"Prepend all of the matched elements to another, specified, set of elements.\nThis operation is, essentially, the reverse of doing a regular\n$(A).prepend(B), in that instead of prepending B to A, you're prepending\nA to B.","tests":[],"type":"jQuery","name":"prependTo","examples":[{"code":"$(\"p\").prependTo(\"#foo\");","result":"<div id=\"foo\"><p>I would like to say: </p><b>Hello</b></div>","before":"<p>I would like to say: </p><div id=\"foo\"><b>Hello</b></div>"}],"cat":"DOM/Manipulation"},{"short":"Insert all of the matched elements before another, specified, set of elements.","params":[{"type":"String","desc":"A jQuery expression of elements to match.","name":"expr"}],"desc":"Insert all of the matched elements before another, specified, set of elements.\nThis operation is, essentially, the reverse of doing a regular\n$(A).before(B), in that instead of inserting B before A, you're inserting\nA before B.","tests":[],"type":"jQuery","name":"insertBefore","examples":[{"code":"$(\"p\").insertBefore(\"#foo\");","result":"<p>I would like to say: </p><div id=\"foo\">Hello</div>","before":"<div id=\"foo\">Hello</div><p>I would like to say: </p>"}],"cat":"DOM/Manipulation"},{"short":"Insert all of the matched elements after another, specified, set of elements.","params":[{"type":"String","desc":"A jQuery expression of elements to match.","name":"expr"}],"desc":"Insert all of the matched elements after another, specified, set of elements.\nThis operation is, essentially, the reverse of doing a regular\n$(A).after(B), in that instead of inserting B after A, you're inserting\nA after B.","tests":[],"type":"jQuery","name":"insertAfter","examples":[{"code":"$(\"p\").insertAfter(\"#foo\");","result":"<div id=\"foo\">Hello</div><p>I would like to say: </p>","before":"<p>I would like to say: </p><div id=\"foo\">Hello</div>"}],"cat":"DOM/Manipulation"},{"short":"Get the current CSS width of the first matched element.","params":[],"desc":"Get the current CSS width of the first matched element.","tests":[],"type":"String","name":"width","examples":[{"code":"$(\"p\").width();","result":"\"300px\"","before":"<p>This is just a test.</p>"}],"cat":"CSS"},{"short":"Set the CSS width of every matched element.","params":[{"type":"String","desc":"Set the CSS property to the specified value.","name":"val"}],"desc":"Set the CSS width of every matched element. Be sure to include\nthe \"px\" (or other unit of measurement) after the number that you\nspecify, otherwise you might get strange results.","tests":[],"type":"jQuery","name":"width","examples":[{"code":"$(\"p\").width(\"20px\");","result":"<p style=\"width:20px;\">This is just a test.</p>","before":"<p>This is just a test.</p>"}],"cat":"CSS"},{"short":"Get the current CSS height of the first matched element.","params":[],"desc":"Get the current CSS height of the first matched element.","tests":[],"type":"String","name":"height","examples":[{"code":"$(\"p\").height();","result":"\"14px\"","before":"<p>This is just a test.</p>"}],"cat":"CSS"},{"short":"Set the CSS height of every matched element.","params":[{"type":"String","desc":"Set the CSS property to the specified value.","name":"val"}],"desc":"Set the CSS height of every matched element. Be sure to include\nthe \"px\" (or other unit of measurement) after the number that you\nspecify, otherwise you might get strange results.","tests":[],"type":"jQuery","name":"height","examples":[{"code":"$(\"p\").height(\"20px\");","result":"<p style=\"height:20px;\">This is just a test.</p>","before":"<p>This is just a test.</p>"}],"cat":"CSS"},{"short":"Get the current CSS top of the first matched element.","params":[],"desc":"Get the current CSS top of the first matched element.","tests":[],"type":"String","name":"top","examples":[{"code":"$(\"p\").top();","result":"\"0px\"","before":"<p>This is just a test.</p>"}],"cat":"CSS"},{"short":"Set the CSS top of every matched element.","params":[{"type":"String","desc":"Set the CSS property to the specified value.","name":"val"}],"desc":"Set the CSS top of every matched element. Be sure to include\nthe \"px\" (or other unit of measurement) after the number that you\nspecify, otherwise you might get strange results.","tests":[],"type":"jQuery","name":"top","examples":[{"code":"$(\"p\").top(\"20px\");","result":"<p style=\"top:20px;\">This is just a test.</p>","before":"<p>This is just a test.</p>"}],"cat":"CSS"},{"short":"Get the current CSS left of the first matched element.","params":[],"desc":"Get the current CSS left of the first matched element.","tests":[],"type":"String","name":"left","examples":[{"code":"$(\"p\").left();","result":"\"0px\"","before":"<p>This is just a test.</p>"}],"cat":"CSS"},{"short":"Set the CSS left of every matched element.","params":[{"type":"String","desc":"Set the CSS property to the specified value.","name":"val"}],"desc":"Set the CSS left of every matched element. Be sure to include\nthe \"px\" (or other unit of measurement) after the number that you\nspecify, otherwise you might get strange results.","tests":[],"type":"jQuery","name":"left","examples":[{"code":"$(\"p\").left(\"20px\");","result":"<p style=\"left:20px;\">This is just a test.</p>","before":"<p>This is just a test.</p>"}],"cat":"CSS"},{"short":"Get the current CSS position of the first matched element.","params":[],"desc":"Get the current CSS position of the first matched element.","tests":[],"type":"String","name":"position","examples":[{"code":"$(\"p\").position();","result":"\"static\"","before":"<p>This is just a test.</p>"}],"cat":"CSS"},{"short":"Set the CSS position of every matched element.","params":[{"type":"String","desc":"Set the CSS property to the specified value.","name":"val"}],"desc":"Set the CSS position of every matched element.","tests":[],"type":"jQuery","name":"position","examples":[{"code":"$(\"p\").position(\"relative\");","result":"<p style=\"position:relative;\">This is just a test.</p>","before":"<p>This is just a test.</p>"}],"cat":"CSS"},{"short":"Get the current CSS float of the first matched element.","params":[],"desc":"Get the current CSS float of the first matched element.","tests":[],"type":"String","name":"float","examples":[{"code":"$(\"p\").float();","result":"\"none\"","before":"<p>This is just a test.</p>"}],"cat":"CSS"},{"short":"Set the CSS float of every matched element.","params":[{"type":"String","desc":"Set the CSS property to the specified value.","name":"val"}],"desc":"Set the CSS float of every matched element.","tests":[],"type":"jQuery","name":"float","examples":[{"code":"$(\"p\").float(\"left\");","result":"<p style=\"float:left;\">This is just a test.</p>","before":"<p>This is just a test.</p>"}],"cat":"CSS"},{"short":"Get the current CSS overflow of the first matched element.","params":[],"desc":"Get the current CSS overflow of the first matched element.","tests":[],"type":"String","name":"overflow","examples":[{"code":"$(\"p\").overflow();","result":"\"none\"","before":"<p>This is just a test.</p>"}],"cat":"CSS"},{"short":"Set the CSS overflow of every matched element.","params":[{"type":"String","desc":"Set the CSS property to the specified value.","name":"val"}],"desc":"Set the CSS overflow of every matched element.","tests":[],"type":"jQuery","name":"overflow","examples":[{"code":"$(\"p\").overflow(\"auto\");","result":"<p style=\"overflow:auto;\">This is just a test.</p>","before":"<p>This is just a test.</p>"}],"cat":"CSS"},{"short":"Get the current CSS color of the first matched element.","params":[],"desc":"Get the current CSS color of the first matched element.","tests":[],"type":"String","name":"color","examples":[{"code":"$(\"p\").color();","result":"\"black\"","before":"<p>This is just a test.</p>"}],"cat":"CSS"},{"short":"Set the CSS color of every matched element.","params":[{"type":"String","desc":"Set the CSS property to the specified value.","name":"val"}],"desc":"Set the CSS color of every matched element.","tests":[],"type":"jQuery","name":"color","examples":[{"code":"$(\"p\").color(\"blue\");","result":"<p style=\"color:blue;\">This is just a test.</p>","before":"<p>This is just a test.</p>"}],"cat":"CSS"},{"short"

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -