Tsallaka zuwa abun ciki
Justice Tech School

Method Chaining

Most jQuery methods return the jQuery object, so you can chain several actions in one statement.

Example
$('#box')
  .css('color', 'red')
  .slideUp(500)
  .slideDown(500);

Exercise

Chain with a ___.

$('p').hide()show()

Quiz Test

Why can methods be chained?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.