<script>
function toggle_table() {
visibility = document.getElementById("table").style.visibility;
document.getElementById("table").style.visibility = (visibility == 'visible') ? 'hidden' : 'visible';
document.getElementById("toggle_table").innerHTML = (visibility == 'visible') ? 'Open' : 'Close';
}
</script>
<form method='POST'>
<a id='toggle_table' href='#' onClick='toggle_table()'>Open</a> WIJZIGEN PROCES
<table id='table' style='visibility: hidden'>
</table>
</form>
This works great. Though I don't want to just make it invisible, I want to not render the innerHTML (so it won't take it's space when invisible). Similar to this question, though I cannot make use of JQuery (requirements). Is this in a rather simple way with plain JavaScript, without the need of putting the whole HTML-content in Javascript?
display:noneto hide it from DOM, not visibility