Hello i have some toggleButton issues.

If i click the button i want to display a table

I have tried this example code but it dont seem to work.
Also another question: what happens if i have another onclick event. Is it possible to have 2. And if so how should i write it. Sorry i am still new with javascript

<table id="myTable">
</table>

<input id="toggleButton" type="button" onclick="hideTable(true);" value="Toggle Table" /

function toggleDisplay(var hide) {
if (hide) {
document.getElementById('myTable').style.display = "none";
document.getElementById('toggleButton').onclick = hideTable(false);
} else {
document.getElementById('myTable').style.display = "table";
document.getElementById('toggleButton').onclick = hideTable(true);
}
}

kind regards