flyingchoc
Programmer
Hello,
I am trying to hide an HTML table when the page initially loads and then display it when a button is clicked.
I have created two functions to do this
Now if I run the hideTable function in the HTML head tag like this:
I get an "getElementById has no properties" error.
If I place it after the line of HTML that creates the table the error goes away but the table always remains hidden.
Any ideas anyone?
Thanks
I am trying to hide an HTML table when the page initially loads and then display it when a button is clicked.
I have created two functions to do this
Code:
function showTable(){
document.getElementById('myTable').style.visibility = "visible";
}
function hideTable(){
document.getElementById('myTable').style.visibility = "hidden";
}
Now if I run the hideTable function in the HTML head tag like this:
Code:
<html>
<head>
<script language="JavaScript">
hideTable();
</script>
...
I get an "getElementById has no properties" error.
If I place it after the line of HTML that creates the table the error goes away but the table always remains hidden.
Any ideas anyone?
Thanks