jQuery Syntax

jQuery Syntax

In the previous lesson, we learned how to run jQuery on local machine to begin working in Windows. Here, we will see how to start with jQuery by learning about its syntax. While working with jQuery, you can use all the functions of JavaScript. Let’s learn about jQuery syntax.

Here’s the syntax,

jQuery uses a document ready event, which we will learn in the upcoming lessons also,

The above function prevents the code from running before the document is ready.

Now, you can also use the $() to write the above code. The meaning and purpose of the code remains the same,

The syntax used inside the document ready event,

         $ = Sign denotes jQuery function to define jQuery
selector = To select HTML elements
actions = To perform action on select element

We will be using the following syntax,

Let’s see an example,

Here’s the output,

jQuery Syntax First Program

In the next lesson we will learn about jQuery Selectors.

How to run jQuery on local machine
jQuery Selectors
Studyopedia Editorial Staff
Studyopedia Editorial Staff
[email protected]

We work to create free tutorials for all.

No Comments

Post A Comment