diff --git a/types/jquery/JQuery.d.ts b/types/jquery/JQuery.d.ts index 915a7b75c0..af509700a7 100644 --- a/types/jquery/JQuery.d.ts +++ b/types/jquery/JQuery.d.ts @@ -6167,6 +6167,81 @@ $( "p span" ).last().addClass( "highlight" ); ``` */ last(): this; + + /** + * Reduce the set of matched elements to the even ones in the set, numbered from zero. + * @see \`{@link https://api.jquery.com/even/ }\` + * @since 3.5 + * @example ​ ````Highlight the even items in a list. +```html + + + + + even demo + + + + + + + + + + + +``` + */ + even(): this; + + /** + * Reduce the set of matched elements to the odd ones in the set, numbered from zero. + * @see \`{@link https://api.jquery.com/odd/ }\` + * @since 3.5 + * @example ​ ````Highlight the odd items in a list. +```html + + + + + odd demo + + + + + + + + + + + +``` + */ + odd(): this; + /** * Load data from the server and place the returned HTML into the matched element. * @param url A string containing the URL to which the request is sent. diff --git a/types/jquery/index.d.ts b/types/jquery/index.d.ts index b42e8fb76c..cba9887578 100644 --- a/types/jquery/index.d.ts +++ b/types/jquery/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for jquery 3.3 +// Type definitions for jquery 3.5 // Project: https://jquery.com // Definitions by: Leonard Thieu // Boris Yankov diff --git a/types/jquery/jquery-tests.ts b/types/jquery/jquery-tests.ts index a0ccb5d0e7..a9f9eb501a 100644 --- a/types/jquery/jquery-tests.ts +++ b/types/jquery/jquery-tests.ts @@ -5925,6 +5925,14 @@ function JQuery() { $('p').find('span').first(); } + function even() { + $('li').even().css('background-color', 'red'); + } + + function odd() { + $('li').odd().css('background-color', 'red'); + } + function offsetParent() { // $ExpectType JQuery $('p').offsetParent();