jQuery - Chain Selectors
jQuery Chain selectors provide a chaining method that allows us to perform multiple jQuery methods on the same element, within a single statement.
jQuery Chain selectors provide a chaining method that allows us to perform multiple jQuery methods on the same element, within a single statement.
Jquery chaining method allows us to add more than the jquery method to the same element, within a single statement.
Jquery chaining method improves the performance of the code since it could not search elements again and again.
Basically, it is a process of attaching the method to the previous method of the selected element.
Please keep in mind that every jquery chaining method returns a jquery object. This is the core concept behind the chaining method.
In the above example, the first <p>
element slides up and then slides down.
jQuery chaining method, a single line of code can be broken into multiple lines of code for greater readability.