Forum: Ruby on Rails Executing multiple JavaScript commands?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
mbonig (Guest)
on 2005-12-01 05:34
(Received via mailing list)
I'm reading in, the only RoR book I could find in the local bookstore,
_Agile Web D. with Rails_. In the Web 2.0 section they talk
using DOM manipulating JavaScript commands like "Element.Toggle(element,
...)". I like how those work, but want to execute multiple commands on

I want to be able to do a:
then a

both on a "onclick" event:
<div id="shade" onclick="$('shade').style.display='none'">

any help would be appreciated.
mvette13 (Guest)
on 2005-12-01 05:43
(Received via mailing list)
Couple ways you could do it...

Make a javascript function....
function clickme(id1, id2) {
     $('id3').style.display='inline'; }
then call the function in the onclick attribute...
<div id="shade" onclick="clickme('shade', 'something_else');">

you can put 2 lines on the onclick attribute (semi-colon separated
<div id="shade"

Hope that helps,
This topic is locked and can not be replied to.