Abhishek Pundir Abhishek Pundir - 1 year ago 45
CSS Question

how to make visible a div which is initially hidden by clicking on button using javascript

I want that my hidden div will be visible continuously after clicking the button.

This is my js code:

document.getElementById("share").onclick=function show(){

This is my html code:

<a id="share" onclick="show()" type="button" class="btn btn-lg btn-default" href="">Share</a>

<div id="taskdiv2" style="visibility:hidden" class="row">
hiiiii !this is vivek.

Answer Source

try this out :

    function becomevisible() {

<!-- language: lang-css -->

    div {
      height: 100px;
      width: 100px;
      opacity: 0;

    <div id="div">Test</div>
    <button onclick="becomevisible()">See the div!</button>