Monday, July 17, 2017

How could We also have added more method calls if needed.

 We could also have added more method calls if needed.

When chaining, the line of code could become quite long. However, jQuery is not very strict on the syntax; you can format it like you want, including line breaks and indentations.
This also works just fine:

Example

$("#p1").css("color", "red")
  .slideUp(2000)
  .slideDown(2000);