In this post, You will find most common questions asked by those developers who are using jQuery for the first time or learning jQuery.
Dollar Sign is nothing but it's an alias for jQuery. Take a look at below jQuery code.
To select element using ID, use (#) sign and the ID of the element.
To select element(s) using CSS, use (.) sign and the css class name. All the elements which are assigned this class will be selected.
To select element(s) using their HTML tag name, then use below syntax. Below code selects all div element(s) exists on the page.
jQuery provides length property for every element which returns 0 if element doesn't exists else length of the element.
Feel free to contact me for any help related to jQuery, I will gladly help you.
1. What is jQuery?
2. What does dollar Sign ($) means in JQuery?
Dollar Sign is nothing but it's an alias for jQuery. Take a look at below jQuery code.
$(document).ready(function(){ });Over here $ sign can be replaced with "jQuery" keyword.
jQuery(document).ready(function(){ });
3. How do I select an element using ID?
To select element using ID, use (#) sign and the ID of the element.
$('#ElementID')
4. How do I select element(s) using CSS Class?
To select element(s) using CSS, use (.) sign and the css class name. All the elements which are assigned this class will be selected.
$('.CssClassName')
5. How do I select element(s) using tag name?
To select element(s) using their HTML tag name, then use below syntax. Below code selects all div element(s) exists on the page.
$('div')To select div elements with any particular CSS class then,
$('div .CssClassName')
6. How to Check element exists or not in jQuery?
jQuery provides length property for every element which returns 0 if element doesn't exists else length of the element.
if ($('#dvText').length) { // your code }
7. How to Enable/Disable element(s)?
8. How to get HTML of any control?
9. How to set HTML of any control?
10. How to check if element is empty?
11. How to check if Checkbox is checked ?
12. How to check if radio button is checked ?
13. Dropdown and jQuery
14. How to detect Browsers using jQuery?
15. Array and jQuery
Feel free to contact me for any help related to jQuery, I will gladly help you.
No comments:
Post a Comment