views:

25

answers:

1

i have the following classes applied to a span tag :

c1

i want to check whether c_2 (any particular class) is applied or not using js

+1  A: 

Use jQuery JavaScript library and things like these are all already implemented in there. You could use the .hasClass() method to check whether an element has a css class

Floyd Pink
i want to use pure javascript, without any framework
Check this out... http://stackoverflow.com/questions/195951/change-an-elements-css-class-with-javascript/196038#196038You *surely* need to do something about your answer acceptance rate, buddy !
Floyd Pink