Amit D has Published 118 Articles

What does the .end() function do in jQuery?

Amit D

Amit D

Updated on 09-Dec-2019 10:01:22

109 Views

The end() method reverts the most recent destructive operation, changing the set of matched elements to its previous state right before the destructive operation.ExampleYou can try to run the following code to learn how to work with end function in jQuery:Live Demo           jQuery end() function ... Read More

How to locate descendant elements of a particular type of elements in jQuery?

Amit D

Amit D

Updated on 09-Dec-2019 09:02:38

272 Views

Use the jQuery find() method to locate descendant elements of particular type of elements in jQuery. The jQuery.find() method will return the descendant elements of the selected element.ExampleYou can try to run the following code to learn how to work with jQuery.find() method, Live Demo  .myclass * ... Read More

How does jQuery.find() method work in jQuery?

Amit D

Amit D

Updated on 09-Dec-2019 09:01:28

81 Views

The jQuery.find() method will return the descendant elements of the selected element.ExampleYou can try to run the following code to learn how to work with jQuery.find() method, Live Demo .myclass * {     display: block;     border: 2px solid red;     padding: 2px;   ... Read More

How does jQuery.eq() method work in jQuery?

Amit D

Amit D

Updated on 09-Dec-2019 08:58:18

117 Views

If you want to return an element with a definite index number of the selected elements, then use the eq() method. The first element has index 0, the second element has index 1, etc. Yes, the index number starts at 0.ExampleYou can try to run the following code to learn ... Read More

How does jQuery.map() method work in jQuery?

Amit D

Amit D

Updated on 09-Dec-2019 08:57:13

334 Views

The map method translates a set of elements in the jQuery object into another set of values in a jQuery array which may, or may not contain elements.The following are the parameters of jQuery.map() method:callback − The function to execute on each element in the set.ExampleYou can try to run the ... Read More

How to select a subset of the matched elements in jQuery()?

Amit D

Amit D

Updated on 09-Dec-2019 08:55:37

191 Views

The slice( start, end ) method selects a subset of the matched elements. The following are the parameters of the slice() method:start − Where to start the subset. The first element is at zero. Can be negative to start from the end of the selection.end − Where to end the subset ... Read More

How to get substring of a string in jQuery?

Amit D

Amit D

Updated on 09-Dec-2019 08:52:02

4K+ Views

To get substring of a string in jQuery, use the substring() method. It has the following two parameters:from: The from parameter specifies the index where to start the substring.to: The to parameter is optional. It specifies the index where to stop the extraction. This is an optional parameter, which extracts ... Read More

What does jQuery.andSelf( ) method do in jQuery?

Amit D

Amit D

Updated on 09-Dec-2019 08:47:18

72 Views

The andSelf( ) method adds the previous selection to the current selection. The method is useful when you have multiple traversals in your script and then adding something that was matched before the last traversal.ExampleYou can try to run the following code to learn how to work with jQuery.andSelf() method:Live ... Read More

How to get objects by ID, Class, Tag, and Attribute in jQuery?

Amit D

Amit D

Updated on 09-Dec-2019 08:04:36

745 Views

Here’s how you can get objects by ID Selector (#id), by Class Selector (.class), by Tag, and Attribute (.attr()).Get Object by Class SelectorExampleThe element class selector selects all the elements which match with the given class of the elements.Live Demo           jQuery Selector       ... Read More

What is the difference between filter() and find() in jQuery?

Amit D

Amit D

Updated on 09-Dec-2019 07:40:19

214 Views

jQuery filter() methodThe jQuery filter() method will return elements matching a specific criteria.ExampleYou can try to run the following code to learn how to work with jQuery.filter() method, Live Demo   $(document).ready(function(){     $("p").filter(".myclass").css("background-color", "gray");   }); Tutorialspoint Free Text ... Read More

Advertisements