just wodering if anyone can help me am using the hide and show elemnts for some reason it doesnt work when i put the hello world in a table but when there is no table it works <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>Project Diary</title> <script type="text/javascript"> window.onload = function() { dispHandle('vanisher'); } function dispHandle(objId) { var obj = document.getElementById(objId); obj.style.display = (obj.style.display == 'none') ? 'block' : 'none'; } </script> </head> <body> <p> <a href="#" onclick="dispHandle('vanisher')">Hide Show</a></p> <table width="200" border="1"> <tr> <td>Hello World</td> </tr> </table> <p> </p> </body> </html>
Your table should look like this: <table width="200" border="1" id="vanisher> You need to apply the id to the table for it to work.