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
https://forums.phpfreaks.com/topic/95708-bug-in-firefox/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.