I have some RJS in a rails app. I'd like to be able to check the style of an html element before executing an action on that element.
I have tried the following
page << "if ($('current_thread_partial').style.display != 'none'){"
puts "HAPPY"
page << "}else{"
puts "SAD"
page << "}"
But the conditional does not execute. In the example here both HAPPY and SAD are printed to console regardless of the whether display is none or not. Any suggestions or another approach?
Cheers,
Slotishtype