Tuesday, February 1, 2011

How to find Html element using multiple css class names in JQuery ?

Hi Friends I would like to share one simple concept in JQuery  :-)

How to find the particular html element using css class name in JQuery ?

 $('.cssclassname') -- For finding the element using cssclass name 

the same way how we can find for the multiple css class names ? This is very simple append the class names without spaces

$('.cssclassname1.cssclassname2........cssclassnameN') - for multiple css class name

Even you can send the dynamic class names at run time also , but remember css calss name is always between singlequote(')  with dot(.) and it should end with single quote('). refer below :-)

$("'."+DynamicCssClassName+"'")




Example:

Please find the below example I have clearly explained how to find the html elements using css class names using JQuery .


I hope you can understand the above html code : Happy coding :)



No comments:

Post a Comment