Accessing DOM node information via RJS

I have been pulling my hair out for way too long on this...and it seems so trivial! The following does not work:

if page['test'].className == "whatever" page['test'].className = "whatever2" end

Now that I write this post, I realize why it doesn't work - className is a value in the Javascript code - not in Rails. But, is there any way to access the className value in the IF statement?

select maybe?

Are you trying to update the style class of a specific node or all of the nodes containing a particular class?

Is the RJS returned from a specific AJAX function link from the node you are interested in? You could use the :with attribute to pass in the style class name if this is the case.