Files
freeCodeCamp/guide/english/jquery/jquery-chaining/index.md
2019-03-04 10:39:06 +05:30

551 B

title
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:

$('#someElement').removeClass('classA');
$('#someElement').addClass('classB');

Into a single statement:

$('#someElement').removeClass('classA').addClass('classB');

More Information:

For more information, please visit the w3schools documentation.