Display block with Onclick

2

Hello,

I do not know much about javascript and needed help, I would like to make a menu that when clicked would change the display of a display div: none to display: block.

My menu

            <div id="back">
                <ul>
                    <li class="li1"><a href="#">O que é?</a></li>
                    <li><a href="#">Objetivo</a></li>
                    <li><a href="#">Pré-requisitos</a></li>
                    <li><a href="#">Público-alvo</a></li>
                    <li><a href="#">Metodologia</a></li>
                    <li><a href="#">Conteúdo</a></li>
                    <li><a href="#">Professores</a></li>
                </ul>
            </div>  
 test     
asked by anonymous 26.09.2014 / 22:38

1 answer

3

Try the following Javascript:

<script>
function exibeDiv(){
var div = document.getElementById("back");
div.style.display = "block";
}
</script>

Html:

<div id='back' onclick='exibeDiv()'>
</div>
    
26.09.2014 / 22:45