diff --git a/.github/configs/hydra-config.json b/.github/configs/hydra-config.json
index 3d367e7b..2173722b 100644
--- a/.github/configs/hydra-config.json
+++ b/.github/configs/hydra-config.json
@@ -1,5 +1,10 @@
{
+ "//": [
+ "2023-05: twitter.com serves broken redirect-loop",
+ "2025-04: The oembed endpoint responds HTTP 429 Too Many Requests too often; perhaps because almost every page links to one"
+ ],
"exclude_scheme_prefixes": [
- "https://twitter.com/"
+ "https://twitter.com/",
+ "https://api.jquery.com/wp-json/oembed/1.0/embed"
]
}
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
new file mode 100644
index 00000000..aa2f7456
--- /dev/null
+++ b/.github/dependabot.yml
@@ -0,0 +1,13 @@
+version: 2
+updates:
+ - package-ecosystem: github-actions
+ directory: "/"
+ schedule:
+ interval: monthly
+
+ # Group all dependabot version update PRs into one
+ groups:
+ github-actions:
+ applies-to: version-updates
+ patterns:
+ - "*"
diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml
index d74cb10f..6b194c62 100644
--- a/.github/workflows/node.js.yml
+++ b/.github/workflows/node.js.yml
@@ -3,8 +3,9 @@
name: Node.js CI
on:
- - push
- - pull_request
+ pull_request:
+ push:
+ branches-ignore: "dependabot/**"
jobs:
build:
@@ -16,13 +17,16 @@ jobs:
node-version: [18.x, 20.x]
steps:
- - name: Install xmllint
- run: sudo apt-get install -y libxml2-utils
- - uses: actions/checkout@v3
- - name: Use Node.js ${{ matrix.node-version }}
- uses: actions/setup-node@v3
- with:
- node-version: ${{ matrix.node-version }}
- cache: 'npm'
- - run: npm ci
- - run: npm test
+ - name: Checkout
+ uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
+ - name: Update apt-get cache
+ run: sudo apt-get update
+ - name: Install xmllint
+ run: sudo apt-get install -y libxml2-utils
+ - name: Use Node.js ${{ matrix.node-version }}
+ uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
+ with:
+ node-version: ${{ matrix.node-version }}
+ cache: 'npm'
+ - run: npm ci
+ - run: npm test
diff --git a/.github/workflows/spider-check.yaml b/.github/workflows/spider-check.yaml
index 8640892f..ac635ea4 100644
--- a/.github/workflows/spider-check.yaml
+++ b/.github/workflows/spider-check.yaml
@@ -9,22 +9,22 @@ on:
push:
paths:
- .github/workflows/spider-check.yaml
+ - .github/configs/hydra-config.json
pull_request:
paths:
- .github/workflows/spider-check.yaml
+ - .github/configs/hydra-config.json
jobs:
spider-check:
if: ${{ github.repository_owner == 'jquery' }} # skip on forks
- env:
- MY_SITE: https://api.jquery.com
runs-on: ubuntu-latest
env:
# Site address to crawl
MY_SITE: https://api.jquery.com
steps:
- - name: Checkout repo
- uses: actions/checkout@v3
+ - name: Checkout
+ uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Run hydra-link-checker
run: |
diff --git a/.github/workflows/typesense.yaml b/.github/workflows/typesense.yaml
index da194255..c9698275 100644
--- a/.github/workflows/typesense.yaml
+++ b/.github/workflows/typesense.yaml
@@ -16,7 +16,8 @@ jobs:
if: ${{ github.repository_owner == 'jquery' }} # skip on forks
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v3
+ - name: Checkout
+ uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Docsearch Scraper
shell: bash
run: |
diff --git a/.nvmrc b/.nvmrc
index f599e28b..3c032078 100644
--- a/.nvmrc
+++ b/.nvmrc
@@ -1 +1 @@
-10
+18
diff --git a/categories.xml b/categories.xml
index 2f408651..0fded172 100644
--- a/categories.xml
+++ b/categories.xml
@@ -37,60 +37,83 @@
The difference between attributes and properties can be important in specific situations. Before jQuery 1.6, the For example, Concerning boolean attributes, consider a DOM element defined by the HTML markup Concerning boolean attributes, consider a DOM element defined by the HTML markup When setting multiple attributes, the quotes around attribute names are optional. To remove an attribute, either call Note: Because ARIA attributes frequently associate behavior with "false" values that differs from attribute absence, passing WARNING: When setting the 'class' attribute, you must always use quotes! Note: Attempting to change the As with the Also, jQuery can equally interpret the CSS and DOM formatting of multiple-word properties. For example, jQuery understands and returns the correct value for both When a number is passed as the value, jQuery will convert it to a string and add In jQuery 3.x or older, when a number is passed as the value, jQuery will convert it to a string and add In jQuery 4.0 or newer, when a number is passed as the value, jQuery will only convert it to a string and add When using Note: As of jQuery 1.8, the Given a document with six paragraphs, this example will set the HTML of This method uses the browser's This method uses the browser's To set the content of a Note: In Internet Explorer up to and including version 9, setting the text content of an HTML element may corrupt the text nodes of its children that are being removed from the document as a result of the operation. If you are keeping references to these DOM elements and need them to be unchanged, use This API is called every time an error is thrown inside Deferreds. By default, it only warns about errors that are more likely to be programmer errors than errors thrown due to application logic. This includes errors like The function accepts two parameters - the first one is the error thrown and the second, optional parameter is a "fake" error created before the handler is called so that a stack trace from before an async barrier is available. This second error is only provided if Note: This API is not defined by default, but jQuery will make use of it when defined. When When defined, an error returned by this API is passed to Prior to jQuery 3.0, Deferreds would simply terminate and the browser would generate a message on the console if an exception occurred such as attempting to call an undefined method as a function (e.g., The native Note: This API has been deprecated in jQuery 3.7; please use the Note: This API is not defined by default, but jQuery will make use of it when defined. See However, when such a stack is then logged by jQuery from inside of If the request is successful, the status code functions take the same parameters as the success callback; if it results in an error (including 3xx redirect), they take the same parameters as the If the request is successful, the status code functions take the same parameters as the success callback; if it results in an error (including 3xx redirects to another domain), they take the same parameters as the If If If For more information on JSONP, see the original post detailing its use. For more information on JSONP, see the original post detailing its use. By default, Ajax requests are sent using the GET HTTP method. If the POST method is required, the method can be specified by setting a value for the The You can think about The keys of the Note: This API has been removed in jQuery 4.0; please pass a string value with the desired units instead. You can think about The keys of the By default the object contains the following properties: jQuery selector engine first tries to run the passed selector — with some modifications — through native jQuery supports virtually all CSS 3 Selectors, including escaped selectors ( As such, the following pseudo-selectors are not supported: Note: These CSS3 pseudo-selectors were unsupported prior to version 1.9: Note: In this context, In this context, "positional" refers to an element's placement in the collection after a selection, based on document order. For example, Note: Positional indexes begin at zero. The jQuery Selection API consists of 3 parts: The main function for finding elements. Uses returns (Array): All elements matching the selector Parameters selector: A CSS selector context: An element, document, or document fragment to use as the context for finding elements. Defaults to results: An array or an array-like object, to which jQuery will append results. For example, jQuery passes a jQuery collection. An "array-like object" is an object with a nonnegative numeric Uses native returns(Boolean): Whether the given element matches the selector Parameters element: A selector: A CSS selector returns(Array): Elements in the array that match the given selector Parameters selector: A CSS selector elements: An array of This contains the regular expressions used to parse a selector into different parts, to be used for finding and filtering. The name of each of the regular expressions should correspond to the names specified in the In order to add a new find function: A method for finding some elements on a page. The specified function will be called no more than once per selector. In order to add a new filtering statement: An optional pre-filter function which allows filtering of the matched array against the corresponding regular expression, which will return a new matched array. This matched array will eventually be passed and flattened as arguments against the corresponding filter function. This is intended to clean up some of the repetitive processing that occurs in a filter function. Note: The arguments for a filter method are the element and the captures from the regex corresponding to this filter (indicated above by what is in the match, starting at index 1). The return result must be boolean: true if the element matches the selector, false if not. Handle an attribute which requires specialized processing (such as The most common extension to a selector engine: adding a new pseudo. The return result from this function must be boolean: true if the element matches the selector, false if not. For example, this defines a simple Note: In jQuery 1.8 and earlier, the API for creating custom pseudos with arguments was broken. In jQuery 1.8.1+, the API is backwards-compatible. Regardless, the use of Now that the parser compiles a single function containing other functions, custom pseudo-selectors with arguments are much cleaner. For example, within jQuery, the implementation of the These filters are run after a previous part of a selector has already returned results. For example, the code for the It is easy to extend jQuery selection engine — even jQuery's Note: Functionality should be accessed via the Public and Extension APIs. While the Internal API is intended specifically for internal use, it has been exposed for edge cases. jQuery internally caches compiled selector functions and tokenization objects. The length of these caches defaults to 50, but can be set to any positive integer by assigning to this property. This method compiles a selector function and caches it for later use. For example, calling returns(Function): The compiled function to be used when filtering the set of possibly matching elements Parameters selector: A CSS selector By default, elements are created with an If the HTML is more complex than a single tag without attributes, as it is in the above example, the actual creation of the elements is handled by the browser's When passing in complex HTML, some browsers may not generate a DOM that exactly replicates the HTML source provided. As mentioned, jQuery uses the browser's Filtering isn't, however, limited to these tags. For example, Internet Explorer prior to version 8 will also convert all Filtering isn't, however, limited to these tags. For example, Internet Explorer prior to version 8 will also convert all To ensure cross-platform compatibility, the snippet must be well-formed. Tags that can contain other elements should be paired with a closing tag: Tags that cannot contain elements may be quick-closed or not: When passing HTML to See the description for See the description for The
diff --git a/entries/attr.xml b/entries/attr.xml
index 03baf91c..ac3e5a1b 100644
--- a/entries/attr.xml
+++ b/entries/attr.xml
@@ -26,7 +26,7 @@
Attributes vs. Properties
.attr() method sometimes took property values into account when retrieving some attributes, which could cause inconsistent behavior. As of jQuery 1.6, the .prop() method provides a way to explicitly retrieve property values, while .attr() retrieves attributes.selectedIndex, tagName, nodeName, nodeType, ownerDocument, defaultChecked, and defaultSelected should be retrieved and set with the .prop() method. Prior to jQuery 1.6, these properties were retrievable with the .attr() method, but this was not within the scope of attr. These do not have corresponding attributes and are only properties.<input type="checkbox" checked="checked" />, and assume it is in a JavaScript variable named elem:<input type="checkbox" checked="" />, and assume it is in a JavaScript variable named elem:
+
@@ -44,12 +44,19 @@
- elem.getAttribute( "checked" )
+ "checked" (String) Initial state of the checkbox; does not change
+ "" (String) Initial state of the checkbox; does not change
+
+
+ $( elem ).attr( "checked" )
+ (4.0+)
+ "" (String) Initial state of the checkbox; does not change
@@ -131,6 +138,7 @@ The title of the emphasis is:
$( elem ).attr( "checked" )
- (1.6+)
+ (1.6-3.x)
"checked" (String) Initial state of the checkbox; does not changenull, the specified attribute will be removed (as in .removeAttr()).null, the specified attribute will be removed (as in .removeAttr()). Non-ARIA attributes can also be removed by passing false.Removing an attribute
+ .attr( name, null ) or use .removeAttr( name ). For non-ARIA attributes, in jQuery 4.0+ you can also call .attr( name, false ).false as the value for an attribute whose name starts with "aria-…" will stringify that value to "false" rather than remove the attribute. To guarantee removal of an attribute, use the .removeAttr() method or provide null as the value to the .attr() setter.type attribute on an input or button element created via document.createElement() will throw an exception on Internet Explorer 8 or older..prop() method, the .css() method makes setting properties of elements quick and easy. This method can take either a property name and value as separate parameters, or a single object of key-value pairs..css({ "background-color": "#ffe", "border-left": "5px solid #ccc" }) and .css({backgroundColor: "#ffe", borderLeft: "5px solid #ccc" }). Notice that with the DOM notation, quotation marks around the property names are optional, but with CSS notation they're required due to the hyphen in the name.px to the end of that string. If the property requires units other than px, convert the value to a string and add the appropriate units before calling the method.px to the end of that string. However, there are exceptions. px is not added to keys of jQuery.cssNumber If the property requires units other than px, convert the value to a string and add the appropriate units before calling the method.px to the end of that string for a limited set of properties - mostly related to width, height, border, margin & padding; the full list:
+
top, right, bottom, leftwidth, height, min-width, min-height, max-width, max-heightpadding-related: padding, padding-top, padding-right, padding-bottom, padding-leftmargin-related: margin, margin-top, margin-right, margin-bottom, margin-leftborder-related: border, border-width, border-top, border-top-width, border-right, border-right-width, border-bottom, border-bottom-width, border-left, border-left-width.css() as a setter, jQuery modifies the element's style property. For example, $( "#mydiv" ).css( "color", "green" ) is equivalent to document.getElementById( "mydiv" ).style.color = "green". Setting the value of a style property to an empty string — e.g. $( "#mydiv" ).css( "color", "" ) — removes that property from an element if it has already been directly applied, whether in the HTML style attribute, through jQuery's .css() method, or through direct DOM manipulation of the style property. As a consequence, the element's style for that property will be restored to whatever value was applied. So, this method can be used to cancel any style modification you have previously performed. It does not, however, remove a style that has been applied with a CSS rule in a stylesheet or <style> element. Warning: one notable exception is that, for IE 8 and below, removing a shorthand property such as border or background will remove that style entirely from the element, regardless of what is set in a stylesheet or <style> element..css() doesn't support !important declarations. So, the statement $( "p" ).css( "color", "red !important" ) does not turn the color of all paragraphs in the page to red as of jQuery 3.6.0. Do not depend on that not working, though, as a future version of jQuery may add support for such declarations. It's strongly advised to use classes instead; otherwise use a jQuery plugin..css() setter will automatically take care of prefixing the property name. For example, take .css( "user-select", "none" ) in Chrome/Safari will set it as -webkit-user-select, Firefox will use -moz-user-select, and IE10 will use -ms-user-select.<div class="demo-container"> to <p>All new content for <em>6 paragraphs!</em></p>.innerHTML property. Some browsers may not generate a DOM that exactly replicates the HTML source provided. For example, Internet Explorer prior to version 8 will convert all href properties on links to absolute URLs, and Internet Explorer prior to version 9 will not correctly handle HTML5 elements without the addition of a separate compatibility layer.innerHTML property. Some browsers may not generate a DOM that exactly replicates the HTML source provided. For example, Internet Explorer prior to version 8 will convert all href properties on links to absolute URLs, and Internet Explorer prior to version 9 will not correctly handle HTML5 elements without the addition of a separate compatibility layer.<script> element, which does not contain HTML, use the .text() method and not .html()..empty().html( string ) instead of .html(string) so that the elements are removed from the document before the new string is assigned to the element.SyntaxError or ReferenceError.jQuery.Deferred.getErrorHook is defined; see the docs for that API for more details.Example
+
+ jQuery.Deferred.getErrorHook is defined, it extends the jQuery.Deferred features added in jQuery 3.0 to include an error captured before the async barrier whenever a Deferred throws an exception. This makes it easier to find programming errors that occur inside Deferreds. You can find an example implementation you can copy-paste below, or you can use jquery-deferred-reporter plugin.
+
+jQuery.Deferred.getErrorHook = function() {
+ try {
+ throw new Error( "Exception in jQuery.Deferred" );
+ } catch ( err ) {
+ return err;
+ }
+};
+ jQuery.Deferred.exceptionHook as the second parameter.Why does this API exist?
+ myobject.missingFunction()). As of version 3.0, jQuery.Deferred follows the Promise/A+ specification when you use the .then method. The spec requires all errors to be trapped by the Promise, which prevents console errors from being logged. If the user has forgotten to add a handler for rejected promises, this can result in the error being silently swallowed with no notification at all!Promise object as implemented in the browser tracks Promise rejections and reports problems on the console. However, doing the same type of reporting in the JavaScript world is much more difficult. jQuery itself is unable to use the native Promise because jQuery.Deferred implements a superset of Promise that requires additional features for methods like .done or .fail, and because Promise is not implemented on all the platforms that jQuery supports.jQuery.Deferred.getErrorHook method instead.jQuery.Deferred.getErrorHook for the context why this API was created. Initially, we advised users to assign to it a function returning an error stack:
+
+jQuery.Deferred.getStackHook = function() {
+ try {
+ throw new Error( "Exception in jQuery.Deferred" );
+ } catch ( err ) {
+ return err.stack; // stack property returned here
+ }
+};
+ jQuery.Deferred.exceptionHook, the browser won't apply source maps. Therefore, we changed the recommendation to return the full error object itself. To make it clearer, the API was also renamed.error callback.error callback. 3xx redirects to the same domain are handled by the browser and are not controlled by jQuery.json is specified, the response is parsed using jQuery.parseJSON before being passed, as an object, to the success handler. The parsed JSON object is made available through the responseJSON property of the jqXHR object.script is specified, $.ajax() will execute the JavaScript that is received from the server before passing it on to the success handler as a string.jsonp is specified, $.ajax() will automatically append a query string parameter of (by default) callback=? to the URL. The jsonp and jsonpCallback properties of the settings passed to $.ajax() can be used to specify, respectively, the name of the query string parameter and the name of the JSONP callback function. The server should return valid JavaScript that passes the JSON response into the callback function. $.ajax() will execute the returned JavaScript, calling the JSONP callback function, before passing the JSON object contained in the response to the $.ajax() success handler.Sending Data to the Server
type option. This option affects how the contents of the data option are sent to the server. POST data will always be transmitted to the server using UTF-8 charset, per the W3C XMLHTTPRequest standard.data option can contain either a query string of the form key1=value1&key2=value2, or an object of the form {key1: 'value1', key2: 'value2'}. If the latter form is used, the data is converted into a query string using jQuery.param() before it is sent. This processing can be circumvented by setting processData to false. The processing might be undesirable if you wish to send an XML object to the server; in this case, change the contentType option from application/x-www-form-urlencoded to a more appropriate MIME type..css() method uses this object to see if it may append px to unitless values..css() method uses this object to see if it may append px to unitless values.jQuery.cssNumber as a list of all CSS properties you might use without a unit. It's used by .css() to determine if it needs to add px to unitless values.jQuery.cssNumber object are camel-cased and the values are all set to true. If you want to prevent the .css() method from automatically adding the px unit for a specific CSS property, you can add an extra property to the jQuery.cssNumber object.jQuery.cssNumber as a list of all CSS properties you might use without a unit. Prior to jQuery 4.0, it was used by .css() to determine if it needs to add px to unitless values.jQuery.cssNumber object are camel-cased and the values are all set to true. If you want to prevent the .css() method from automatically adding the px unit for a specific CSS property and that property is not yet a key of the jQuery.cssNumber object, you can add such an extra property:
-jQuery.cssNumber.someCSSProp = true;
+if ( jQuery.cssNumber ) {
+ jQuery.cssNumber.someCSSProp = true;
+}
-
zIndexfontWeightopacityzoomlineHeightwidows (added in jQuery 1.6)orphans (added in jQuery 1.6)fillOpacity (added in jQuery 1.6.2)columnCount (added in jQuery 1.9)order (added in jQuery 1.10.2)flexGrow (added in jQuery 1.11.1)flexShrink (added in jQuery 1.11.1)animationIterationCount (added in 1.12.0/2.2.0)aspectRatio (added in 3.7.0)borderImageSlice (added in 3.7.0)columnCount (added in 1.9.0)flexGrow (added in 1.11.1/2.1.1)flexShrink (added in 1.11.1/2.1.1)fontWeight (added in 1.4.3)gridArea (added in 3.4.0)gridColumn (added in 3.4.0)gridColumnEnd (added in 3.4.0)gridColumnStart (added in 3.4.0)gridRow (added in 3.4.0)gridRowEnd (added in 3.4.0)gridRowStart (added in 3.4.0)lineHeight (added in 1.4.3)opacity (added in 1.4.3)order (added in 1.10.2/2.0.3)orphans (added in 1.6.0)scale (added in 3.7.0)widows (added in 1.6.0)zIndex (added in 1.4.3)zoom (added in 1.4.3)fillOpacity (SVG-related, added in 1.6.2)floodOpacity (SVG-related, added in 3.7.0)stopOpacity (SVG-related, added in 3.7.0)strokeMiterlimit (SVG-related, added in 3.7.0)strokeOpacity (SVG-related, added in 3.7.0)jQuery.find. This page describes all the APIs under jQuery.find.
+ Note
+
+ querySelectorAll, so selectors natively supported by the current browsers generally work out of the box. However, if the browser does not recognize the selector, jQuery does the whole selection on its own. Some newer selectors may not work with such a jQuery selection.Selectors
+
+ CSS 3
+
+ .foo\+bar), Unicode selectors, and results returned in document order. The only exceptions are those that would require additional DOM event listeners to keep track of the state of elements.
+
+
+ :hover:active:visited, :link
+
+
+ :target:root:nth-last-child:nth-of-type, :nth-last-of-type, :first-of-type, :last-of-type, :only-of-type:lang()Other selectors and conventions
+
+ Changes
+
+
+
+
+ :not(); e.g. :not(a.b), :not(div > p), :not(div, p):not(:has(div:first-child))Additions
+
+
+
+
+ [NAME!=VALUE]: Elements whose NAME attribute doesn't match the specified value. Equivalent to :not([NAME=VALUE]).:contains(TEXT): Elements with textContent containing the word 'TEXT'. Case-sensitive.:header: Header elements (h1, h2, h3, h4, h5, h6).:parent: Elements with at least one child node (either text or an element).:selected: (option) elements that are currently selectedForm Selector Additions
+
+ input, button, select, and textarea are all considered to be input elements.
+
+
+ :input: Input elements:button: Input elements that are buttons or have type "button":checkbox, :file, :image, :password, :radio, :reset, :submit, :text: Input elements with the specified typePositional Selector Additions
+
+ div:first would return an array containing the first div on the page, while div:first em would target the first div on the page and select all em elements within.
+
+
+ :first/:last: The first/last matching element:even/:odd: Even/odd-numbered elements:eq/:nth: The nth element; e.g. :eq(5) finds the 6th element:lt/:gt: Elements at positions above/below the specified positionAPI
+
+
+
+
+ Public API
+
+
+
+ jQuery.find( String selector[, DOMNode context[, Array results]] )querySelectorAll if available.document.
+ Note: Prior to version 2.1, document fragments were not valid here.length property and a push method.
+
+ jQuery.find.matchesSelector( DOMElement element, String selector )matchesSelector if availableDOMElement against which jQuery will test the selector
+
+ jQuery.find.matches( String selector, Array<DOMElement> elements )DOMElements to filter against the specified selectorExtension API
+
+
+
+ jQuery.expr.match.NAME = RegExpjQuery.expr.find and jQuery.expr.filter objects.Finding
+
+
+
+
+ match object.find must be defined."|" + NAME must be appended to the jQuery.expr.order regex.
+
+ jQuery.expr.find.NAME = function( match, context, isXML ) {}
+
+
+ match is the array of results returned from matching the specified regex against the selector.context is the DOMElement or DOMDocument from which selection will occur.isXML is a boolean value indicating whether the function is currently operating within an XML document.Filtering
+
+
+
+
+ match object.filter object.preFilter object.
+
+ jQuery.expr.preFilter.NAME = function( match ) {}
+
+ jQuery.expr.filter.NAME: function( element, match[1][, match[2], match[3], ...] ) {}match[0] will be deleted prior to being passed to a filter, and must not be used.Attributes
+
+
+
+ jQuery.expr.attrHandle.LOWERCASE_NAME = function( elem, casePreservedName, isXML ) {}href, which has cross-browser issues). The return result must be the actual string value of that attribute.Pseudo-selectors (pseudos)
+
+
+
+ jQuery.expr.pseudos.NAME = function( elem ) {}:fixed pseudo:
+
+
+var $test = jQuery( document );
+jQuery.expr.pseudos.fixed = function( elem ) {
+ $test[ 0 ] = elem;
+ return $test.css( "position" ) === "fixed";
+};
+
+
+ jQuery.expr.createPseudo( function )createPseudo is only required if the custom pseudo-selector accepts an argument.createPseudo is greatly encouraged.:not( <sub-selector> ) pseudo is very similar to:
+
+
+jQuery.expr.pseudos.not =
+ jQuery.expr.createPseudo( function( subSelector ) {
+ var matcher = jQuery.find.compile( subSelector );
+ return function( elem ) {
+ return !matcher( elem );
+ };
+ } );
+
+
+ jQuery.expr.setFilters.LOWERCASE_NAME = function( elements, argument, not ) {}setFilters are found from matching jQuery.expr.match.POS. When applicable, argument is expected to be an integer. The not argument is a boolean indicating whether the result should be inverted (as in div:not(:first)).:first setFilter is similar to:
+
+
+var first = function( elements, argument, not ) {
+ // No argument for first
+ return not ? elements.slice( 1 ) : [ elements[ 0 ] ];
+};
+jQuery.expr.setFilters.first = first;
+ POS selectors. For example, to rename :first as :uno:
+
+ Internal API
+
+
+
+ jQuery.expr.cacheLength
+
+ jQuery.find.compile( selector )jQuery.find.compile( ".myWidget:myPseudo" ) during initialization of a plugin will speed up the first selection of matching elements.dataType is provided, but you can use null or jQuery.noop as a placeholder.dataType is provided, but you can use null or jQuery.noop as a placeholder. NOTE: In jQuery 3.x and older, when providing a null value for success you also have to provide the data parameter; you can set it to null or undefined.dataType is provided, but can be null in that case.dataType is provided, but can be null or jQuery.noop as a placeholder. NOTE: In jQuery 3.x and older, when providing a null value for success you also have to provide the data parameter; you can set it to undefined..ownerDocument matching the document into which the jQuery library was loaded. Elements being injected into a different document should be created using that document, e.g., $("<p>hello iframe</p>", $("#myiframe").prop("contentWindow").document)..innerHTML mechanism. In most cases, jQuery creates a new <div> element and sets the innerHTML property of the element to the HTML snippet that was passed in. When the parameter has a single tag (with optional closing tag or quick-closing) — $( "<img />" ) or $( "<img>" ), $( "<a></a>" ) or $( "<a>" ) — jQuery creates the element using the native JavaScript .createElement() function..innerHTML property to parse the passed HTML and insert it into the current document. During this process, some browsers filter out certain elements such as <html>, <title>, or <head> elements. As a result, the elements inserted may not be representative of the original string passed.href properties on links to absolute URLs, and Internet Explorer prior to version 9 will not correctly handle HTML5 elements without the addition of a separate compatibility layer.href properties on links to absolute URLs, and Internet Explorer prior to version 9 will not correctly handle HTML5 elements without the addition of a separate compatibility layer.$( "<a href='https://jquery.com'></a>" );
-$( "<img>" );
+$( "<img />" );
$( "<input>" );
jQuery(), note that text nodes are not treated as DOM elements. With the exception of a few methods (such as .content()), they are generally ignored or removed. E.g:"keyup"."keypress"."keyup"."keypress"..on( "keyup", ... )..on( "keypress", ... ).:submit selector typically applies to button or input elements. Note that some browsers treat <button> element as type="submit" implicitly while others (such as Internet Explorer) do not. To ensure that markup works consistently across all browsers and guarantee that it is possible to consistently select buttons that will submit a form, always specify a type property.