If you click on me, I will disappear.
Click me away!
Click me too!
Please Give me the Explanation of these:-
1) why we placing '$' ?
2) document stand for what?
3) what is the use of '.ready'?
4) Is closing brace would be in ' }); ' form?
If you click on me, I will disappear.
Click me away!
Click me too!
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sunny SharmaPosted Sep 6, 2013, 1:17 AM
While answering this question I assume you're a newbie to jQuery. The Sign "$" is a short keyword to represent "jQuery" function. You're free to assign any word or character instead of this '$' dollar sign though this a standard one.
"document" stands for your whole html page that you've loaded in your browser.
".ready()" is a function which is invoked as soon your browser completes downloading your page. The reason behind the way it is used here is, if your page is not loaded completely and you're trying to select an element, it may not be there. So just to mitigate the chances of element not loaded yet in browser and you're searching for it, we check it after the page is loaded, means document is "ready".
The closing braces are totally identical if you try to match every start and close. See and follow the opening and closing of .ready() function and you'll get the idea.
Hope I answered your question.
Besides of that I would suggest you to start learning jQuery, it will help you solve any further jQuery pertaining issues.