Skip to content

Instantly share code, notes, and snippets.

@tiagodavi
Created March 20, 2012 00:55
Show Gist options
  • Save tiagodavi/2129277 to your computer and use it in GitHub Desktop.
Save tiagodavi/2129277 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<!-- Formas elegantes de esconder elementos-->
<div id="conteudo1" hidden>Esconde!</div>
<div id="conteudo2" hidden=”true”>Esconde!</div>
<script type="text/javascript">
//Forma HTML5 de verificar se um elemento está oculto
elm = document.getElementById("conteudo1");
if(elm.hidden){
alert('sim conteudo1 está oculto!');
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment