prova cosi:
codice:
<script>
function mercati_ricerca(mercato,ev){
if(ev.target.id == "ricerca"){
document.getElementById(mercato).style.display = 'none';
}else{
if(document.getElementById(mercato).style.display == 'none'){
document.getElementById(mercato).style.display = 'block';
} else {
document.getElementById(mercato).style.display = 'none';
}
}
}
</script>
<div id="ricerca" style="border:1px solid black; display: block; width:250px; height:300px; background-color:#090;" onclick="mercati_ricerca('vis_energia',event);">
<div id="energia" style="width:150px; height:36px; border:1px solid green; background-color:#F00;"> fdff </div>
<div id="vis_energia" style="background-color: rgb(255, 255, 255); width: 120px; padding:5px;">
ENEL
EDISON
SORGENIA
ALTRO
ENI
FLY
A2A
ITALCOGIM
EON
</div>