Return to Snippet

Revision: 32588
at September 29, 2010 17:49 by Meander365


Initial Code
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="../assets/js/jquery.js"></script>

<script type="text/javascript">
	
$(function () {
	$('html').addClass('no-message');
});
</script>
</head>
<body>
<style type="text/css">
	html.no-message .box {display:none;}
</style>
	<p>In other news...</p>
	<div class="box"><p>I shoud be hidden!</p></div>
</body>
</html>

Initial URL

                                

Initial Description
Handy. Hide an element as soon as possible, before document.ready. The element gets hidden but only when a class is applied to the html via js.

Initial Title
Jquery Hide an Element Right Away

Initial Tags
javascript, jquery

Initial Language
jQuery