RJS alert with a prototype div

I am trying to do an alert showing the value of a div in an RJS:

It gives me an alert but just shows me what is inside the brackets.

Any ideas?

Nope not working.

  Showing <i>buildshelf/remove_card.js.rjs</i> where line <b>#6</b> raised:
<pre><code>ActionView::Helpers::JavaScriptElementProxy#to_str should return String</code></pre>

Guess you are right... I thought that it might work...

anyway.. you could just stay with raw javascript:

page << "alert($('test_alert').value);"

But I'll try to find a better solution...

Ok, thanks. What I am really trying to do is this which I have been banging my head against:

How do I get the dom id to come in?

The 2nd line prints properly in firebug and shows the value but the first line just has “#{@next” in it not the value.

Same idea as the alert but an IF condition I think.

page << ‘if ($("#{@next}").value == “APS”) {’

page[:"#{@next}"].replace_html ‘moo’

page << ‘}’