What is method chaining in jQuery?

<p id="msg">Hi</p>
$('#msg').text('Hello').css('color', 'blue').addClass('big');
HTML after the code runs

<p id="msg" style="color: blue;" class="big">Hello</p>

Getter methods like .text() without an argument return a value, so they end the chain. See Method Chaining.


Learn more about the similar topics:
Tutorials
No Content Found.
Exercises & Assignments
No Content Found.
Interview Questions & Answers
No Content Found.