How can an element be checked if it contains a specific class?



How can an element be checked if it contains a specific class?..

Answer / Devki Nandan Sharma

You can check if an element has a specific class by using the hasClass() method in jQuery. For example, $('element').hasClass('class'); will return true if the element has the specified class.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More jQuery Interview Questions

What is jQuery?

1 Answers  


What are the various ajax functions?

1 Answers  


What is .detach()? : jquery mobile

1 Answers  


Define data paremeter of jquery ajax method?

1 Answers  


Why we need jquery?

1 Answers  


How do I pull a native DOM element from a jQuery object?

1 Answers   MCN Solutions,


How can we add change font size using jquery?

1 Answers  


Explain some features of jquery knockout?

1 Answers  


Difference Between Prop and Attr in jQuery?

1 Answers  


How to find all sibling elements in front of the current element using ?

1 Answers  


Tell me how to select combobox select value and text using jquery?

1 Answers  


What are the browser related issues for jQuery?

1 Answers  


Categories