Call elements of a div with javascript

2

I have a section that is hidden but clicking the button does not work, the truth is that there is almost no javascript, but do not be mocking please.

My css

    .cal{display:none;}
    .calculadora{width:95%;text-align:center;}
    .calculadora a{width:60%;padding:8px 0px;text-align:center;text-decoration:none;background:#222;color:#DDD;display:block;margin-top:5px;border:solid 1px #000;border-radius:8px;font-size:16px;font-family:arial, sans;box-shadow:0 2px 3px rgba(0,0,0,0.12), 2px 3px rgba(0,0,0,0.18);}
    .calculadora a:hover{width:65%;padding:10px 0px;background:#000;color:#00FF99;font-size:18px;}

The javascript attempt

    <script type="text/javascript">
    function calcular(){
    var calcular = document.getElementById("cal")
    calcular[i].style.display = "none";
    }
    </script>

And the html

    <div class="calculadora">
    <a onclick="calcular()" ><strong>Comprueba Tu Talla</strong></a>
    <section class="cal" id="cal">
    <br><h3>¿Cómo Saber Tu Talla Exacta?</h3><br>

Sopongo the problem is the javascript since I know that I am pesimo, I would really appreciate the help.

    
asked by Alst Adm 05.11.2018 в 07:37
source

1 answer

1

Hello again, my friend, because obviously the problem is javascript, since it is not necessary to create variables or anything is the case, because of what I see in your code, you can use the following javascript.

        function calcular(){
                 document.getElementById("cal").style.display = "block";
        }

I hope it helps you.

    
answered by 05.11.2018 / 07:40
source