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. Link to comment https://forums.phpfreaks.com/topic/86547-really-need-help/ 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! Link to comment https://forums.phpfreaks.com/topic/86547-really-need-help/#findComment-442256 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> Link to comment https://forums.phpfreaks.com/topic/86547-really-need-help/#findComment-442262 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.. Link to comment https://forums.phpfreaks.com/topic/86547-really-need-help/#findComment-442556 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.