Add documentation on jQuery chaining (#26702)
This commit is contained in:
committed by
The Coding Aviator
parent
5ba54685a8
commit
cd18e168a6
18
guide/english/jquery/jquery-chaining/index.md
Normal file
18
guide/english/jquery/jquery-chaining/index.md
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
---
|
||||||
|
title: jQuery Chaining
|
||||||
|
---
|
||||||
|
## jQuery Chaining
|
||||||
|
jQuery chaining allows you to execute multiple methods on the same jQuery selection, all on a single line.
|
||||||
|
|
||||||
|
Chaining allows us to turn multi-line statements:
|
||||||
|
```javascript
|
||||||
|
$('#someElement').removeClass('classA');
|
||||||
|
$('#someElement').addClass('classB');
|
||||||
|
```
|
||||||
|
Into a single statement:
|
||||||
|
```javascript
|
||||||
|
$('#someElement').removeClass('classA').addClass('classB');
|
||||||
|
```
|
||||||
|
|
||||||
|
#### More Information:
|
||||||
|
For more information, please visit the [w3schools documentation](https://www.w3schools.com/jquery/jquery_chaining.asp).
|
Reference in New Issue
Block a user