Im using the js function shown below to make a part of page disappear when user clicks on the button. but when i click on the button, the part disappears, but page reloads. why is it like this?
<button id="myDIV" onclick="fncShowHide()">Try it</button>
<script>
window.fncShowHide = function() {
document.getElementById("idein").className = "display-none";
}
</script>