Jump to content

bug in Firefox???


ktsirig

Recommended Posts

Hello,

I have a js function that is triggered with the onclick event. In particular, there is a <tr> in a table that is shown when the user clicks on the "Show" button.

 

In HTML I have:

<tr>  <td>
    <img id="myimage" src="css/images/show.png"           onclick="javascript:HideShow('myrow');"/>
   </td>
</tr><tr id="myrow" style="display:none">
      <td>Hello all!
      </td>
</tr>

and the JS part is:

 

<script type="text/javascript">
function HideShow(myVar)
          {
                if (document.getElementById(myVar).style.display == 'none')
                {
                    document.getElementById(myVar).style.display = 'inline'
                }
                else
                {
                    document.getElementById(myVar).style.display = 'none'
                }
          }
</script>

 

The function works fine, that is, when the user clicks on the image, the tr appears and then, if the user clicks again, it disappears... BUT all these work perfectly with IE, whereas in Firefox, the contents of the tr appear and disappear when the image is clicked, however, when the user clicks twice, the "Hello world" data disappears, but a blank row remains...And, if you do that again and again, I end up with as much blank rows as the times that I click the button for the data to disappear...

 

Is this something like a bug? Can I do anything else?

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.