views:

20

answers:

1

Is there a syntax for getting the class name by id. The class name is dynamic so I can't use

if(Dom.hasClass('id-name-here', 'class-name-here')
{
  Dom.removeClass('id-name-here', 'class-name-here');
  Dom.addClass('id-name-here', 'class-name-here');
}

I can get the src attribute using the id by doing this,

Dom.get('id-name-here').src

But when I try to adapt it to class, it is undefined

Dom.get('id-name-here').class

I am only certain of the id. Can you point me to the right documentation or teach me how...Thank you!

+3  A: 

I think, it is className rather than class:

Dom.get('id-name-here').className;
Sarfraz
I can kiss you right now! Thanks! It worked!
Woppi