RJS question - Query DOM/CSS from RJS?


I understand that I wouldn’t be able to directly query into the
DOM/CSS of a page from within an RJS file because it runs on the
server but is there any way to populate a variable from the controller
or something to gain access to DOM information?

What I want to do is this:

I have some RJS to blind_down an error message panel, but if the form
is resubmitted and there are still errors, the blind_down still plays
from the beginning because the RJS just says to blind_down with no
conditions. I would like to be able to query the visibility of the
error div to determine if I should blind_down or just leave it visible
and replace the content.

Is there any way to do this?