April 2018
Beginner
368 pages
7h 37m
English
We will now have a look at the jQuery syntax. The following syntax is an example of a jQuery and JavaScript code that changes the background of the body:
jQuery$('body').css('background', '#fff'); Javascriptfunction changeBackgroundColor(color) {
document.body.style.background = color;
}
onload="changeBackgroundColor('white');"
You can see the big difference between them.
The basic syntax of jQuery is very simple:
$(selector).action();
For example, to add a class in jQuery, we can use the jQuery ...
Read now
Unlock full access