What is the difference between the id selector and class selector in jquery?



What is the difference between the id selector and class selector in jquery?..

Answer / Tanu Pal

The ID selector selects HTML elements based on their unique ID attribute, using the # symbol followed by the ID value. The Class Selector selects elements based on their class attributes using the . symbol followed by the class name. Unlike IDs, multiple HTML elements can share the same class.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More jQuery Interview Questions

Is jQuery replacement of Java Script?

2 Answers  


Which is fast document.getElementByID('txtName') or $('#txtName').?

1 Answers  


How to select combobox select value and text using jquery?

1 Answers  


Can you give me a brief history of your programming days? Where did it all start?

1 Answers  


What is the advantage of using protocol less URL while referencing jQuery from CDNs?

1 Answers  


What is the difference between settimeout() and setinterval() methods?

1 Answers  


What is finish method in jQuery?

1 Answers  


Different ways of using $.connect function in jquery?

1 Answers  


Mention the differences between javascript and jquery.

1 Answers  


How can we apply css in last child of parent using jquery library?

1 Answers  


Why use jQuery filter() Methods?

1 Answers  


What is event.stoppropagation? : jquery mobile

1 Answers  


Categories