Object.style.display = value
<script type="text/javascript"> function hidetext() { var mychar = document.getElementById("con"); mychar.style.display = "none"; } function showtext() { var mychar = document.getElementById("con"); mychar.style.display = "block"; } </script>