# Changing a \<tr\> display onClick

**URL:** <https://www.ruby-forum.com/t/changing-a-tr-display-onclick/142972>\
**Category:** Rails\
**Created:** [July 14, 2008, 4:31am UTC](https://www.ruby-forum.com/t/changing-a-tr-display-onclick/142972 "2008-07-14T04:31:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jturney](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e99b99/32.png) [@jturney](https://www.ruby-forum.com/u/jturney)\
**Post date:** [July 14, 2008, 4:31am UTC](https://www.ruby-forum.com/t/changing-a-tr-display-onclick/142972/1 "2008-07-14T04:31:43Z")

</div>

onclick=" \<%= user.email %\>.tr.style.display=‘inline’ "

```
        <div id="<%= user.email %>">
          <tr class="row-details" id="tr" style="display: none;">
            <td>sdf</td>
          </tr>
        </div>

```

this obviously doesn’t work. Any tips?

Also, when I use div class=“display:none”…it doesn’t work. It only  
works with

.

Thanks for the help!

---

<div class="post-metadata">

**Author:** ![jturney](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e99b99/32.png) [@jturney](https://www.ruby-forum.com/u/jturney)\
**Post date:** [July 17, 2008, 6:28pm UTC](https://www.ruby-forum.com/t/changing-a-tr-display-onclick/142972/2 "2008-07-17T18:28:05Z")

</div>

It looks like you need to work a bit on your stylesheet knowledge.

You are mixing up the distinction between class and style.

The style contains the style values and these are referenced by either  
the class name or id name. (very much in brief).

I suggest you start by writing out each element with the styles hard  
coded. Then write out each variation you require. Get these working  
so that the styles are correct. If you need style help then go to a  
css group such as Css-discuss.

Once you have your styles correct then you will see which vaues you  
need to change and then you can work out what you need to do to change  
them.

Tonypm
