I know you have a lot of topics talking about "how to make a div appear and disappear with JScript", most of them teach to do:
document.getElementById('divaqui').style.visibility = 'hidden';
document.getElementById('divaqui').style.visibility = 'visible';
But I need to do it a little differently
I've deleted all images (and div's within this div conteudo
) from a div through this function
function limpaConteudo()
{
$(conteudo).empty()
}
Now I need to make one of the div's appear again inside the conteudo
that was cleaned.
I do not know if I was clear. Home
Can you help me? Obg
function limpaConteudo()
{
$(conteudo).empty()
document.getElementById('conteudo').style.background='#fff';
}
#conteudo{
width:250px;
height:250px;
float:left;
background-color:#ff1;
display: initial;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script><html><body><divid="conteudo" class="conteudo">
<img src="https://png.icons8.com/view-as-different-user/ios7/50"></div><divid="lixoLimpaConteudo">
<img src="https://png.icons8.com/view-as-different-user/ios7/50"onclick="limpaConteudo()" alt="Limpar conteúdo">
</div>
</body>
</html>