One of the important concepts in jQuery is a call to '$'.
'$' Is a pseudonym for the space 'jQuery'.
Few simple examples of using jQuery
Examples
Example 1
jQuery provides a function that removes extra spaces from a stringExample 1a
jQuery provides a function that removes extra spaces from a string: shortest wayThis example is similar to the previous one. Use '$' instead of 'jQuery' is a simpler and shorter way to refer to objects with the jQuery library
Example 2
The following function adds a class called bar for all paragraphs (p) that have a class named fooExample 3
In the following example function with name 'myfunc' is executed immediately after loading the page:$(document).ready(function() { myfunc(); });
Example 4
In the following example for each even row is added class name oddStripe, and for the odd rows - class name evenStripe$(document).ready(function() { // Stripe all the tables in the document using the
oddStripe and evenStripe CSS classes. $('tr:odd').addClass("oddStripe"); $('tr:even').addClass("evenStripe"); });
Was this information helpful?

