ktsirig Posted March 11, 2008 Share Posted March 11, 2008 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? Quote Link to comment Share on other sites More sharing options...
nogray Posted March 12, 2008 Share Posted March 12, 2008 I tested your code an it works fine, could be a problem with something else in your code. Try to isolute all the events and try them one by one to see what's causing the issue. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.