Understanding the Basic Behavior of jQuery Scripts - PHP and Jquery

One of the most convenient features of jQuery is the fact that nearly all its methods are chainable, which means methods can be executed one right after the other. This leads to clear, concise code that is easy to follow:

$('p')
.addClass('new-class')
.text("I'm a paragraph!")
.appendTo('body');

Chainable methods are possible because each method returns the jQuery object itself after modification. At first, this concept may seem difficult to understand, but as you work through the examples.


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

PHP and Jquery Topics