⊗jqBsGS 4 of 113 menu

Getting Started with jQuery

Working with the jQuery library is done using the universal function $, which for brevity consists of just one character.

After the dollar, you should write parentheses (this is a function), in which the parameters are indicated (usually one parameter), something like this: $(parameter).

Most often, using the dollar $, you get a group of HTML elements by CSS selector.

Let's get all elements with class www:

let elems = $('.www');

Now we'll get only paragraphs with class p.www:

let elems = $('p.www');

Now we get an element with id equal to www:

let elems = $('#www');

As you can see, regular CSS selectors are used, similar to the querySelectorAll method. Only querySelectorAll appeared much later than jQuery, and has fewer capabilities (but works faster).

English
AfrikaansAzərbaycanБългарскиবাংলাБеларускаяČeštinaDanskDeutschΕλληνικάEspañolEestiSuomiFrançaisहिन्दीMagyarՀայերենIndonesiaItaliano日本語ქართულიҚазақ한국어КыргызчаLietuviųLatviešuМакедонскиMelayuမြန်မာNederlandsNorskPolskiPortuguêsRomânăРусскийසිංහලSlovenčinaSlovenščinaShqipСрпскиSrpskiSvenskaKiswahiliТоҷикӣไทยTürkmenTürkçeЎзбекOʻzbekTiếng Việt
We use cookies for website operation, analytics, and personalization. Data processing is carried out in accordance with the Privacy Policy.
accept all customize decline