I would like to toggle (hide/show) several elements of my web page.
All those elements are in between this tag:
<div class="class_name">to toggle</div>
<div class="class_name">to toggle2</div>
I would like to use javascript to toggle all the elements with class=class_name when the user clicks on a button.
So far all the code I found only hides div by ID.
I am working with ruby on rails, so if there is a way not to write the js code and not create new functions I would appreciate. I would also like a way to call visual effects but on class and not id.
Thanks.