In this blog you are told about the basic syntax of jQuery
Before this, we learned Java Script.
In which we first write and inside we used to write Java code, suppose we have to take the inner HTML of a page’s div, then write a small code like
In which we write scripts like this
I have taken a small code like variable a and created a selector like document.getElementbyId and took the name of its id, got the help of its term inner HTML from which you took away its inner HTML.
And given the value of all of these to a and we used to print the value of a in the console.
So here we wanted to tell you how to print your code in java script
jQuery
If we have to do this work inside jQuery, then the first script tag we get, why should the script be done because jQuery is the JavaScript itself, but Lichen jQuery has to write a small script for standing something like this.
Here you pay $ and then you have a selector
Like we have written document.ready, so this is about
As soon as the document is ready, a function will run and after that those who can further code their jQuery.
So remember whenever we write a script of jQuery, it is important to write it
So let’s understand what this script means
So the images above are in here $ and after that, we write the name of any selector as soon as the document is taken in the image above.
So this part is one right and left,
The part that is left is called the selector and the right wall is called a method ().
We use the selector to target the DOM element, and that is our method, that is when our document is ready, we can do whatever we want to do in ().
Now we will talk as soon as our document is ready so how did we code in it, then we have to take a function.
Now we see in this how we work, suppose we have a div in HTML, and some HTML is written in it, and we have put an idle in it with the name “test”, now we target it Its inner HTML has been picked down, first, we took a variable and we will name it in some image which is written
In that way and inside like an image with a value synced and not to write the inner HTML here, because everything becomes smaller in the query, all of this value has been lifted from the HTML, the value of a console. People will print
Another Method to start jQuery Code:
This code was sometimes worked when you wrote it at the end of the body tag.
So come, now we see a small demo, jQuery something like this
Example
This “console” result
- Discover the Heart of India with Mera Apna Bihar - December 20, 2024
- Experience the Pulse of Bangalore with Bangalore Orbit - December 20, 2024
- Discover the City of Lakes with Bhopal Orbit - December 20, 2024