toggleDisplay - Issue

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

Hello i have fixed my problem.
Instead of using a button i decided to use a check box and that seem to work.

I am still wondering if it is possible to use 2 on click events.

Thanks anyway

You can have two click events on the same element. In situations like that it’s better to use advanced event registration to do so.