salhzmzm Posted January 17, 2008 Share Posted January 17, 2008 hi I have a little problem with this code. so mybe you can help me. function do() { if (document.getElementById('MyId').style.display='none' { document.getElementById('MyId').style.display='' ; else { document.getElementById('MyId').style.display='none' ; } } } in the html page I type <table id='mytable'> <tr> <td>sfsdfsdf</td> <tr> </table> <a href='#' onclick='do()'>hide/show</a> so please help me. Quote Link to comment Share on other sites More sharing options...
tinker Posted January 17, 2008 Share Posted January 17, 2008 see this, it was at the top when you posted! Quote Link to comment Share on other sites More sharing options...
phpQuestioner Posted January 17, 2008 Share Posted January 17, 2008 <script language="javascript"> function doIt() { var myTable = document.getElementById('MyId').style.display; if (myTable == "none") { document.getElementById('MyId').style.display='block' ; } else { document.getElementById('MyId').style.display='none' ; } } </script> <table id='MyId'> <tr> <td>sfsdfsdf</td> <tr> </table> <a href='#' onclick='doIt()'>hide/show</a> Quote Link to comment Share on other sites More sharing options...
roshanbh Posted January 18, 2008 Share Posted January 18, 2008 try putting the table inside the div i.e <div id='myid'> <table>...</table></div>.Hope this will work.. 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.