[Solved] How do I show a div with a form only if a button is clicked?


You can use the onClick event to do that:

Working Example

HTML:

<button id="some_id">Hide div</button>

<form id="some_form">

<form>

javascript:

<script type="text/javascript">
    var theButton = document.getElementById('some_id');
    
    theButton.onclick = function() { 
        document.getElementById('some_form').style.visibility='hidden';   
    }
    
</script>
   

2

solved How do I show a div with a form only if a button is clicked?