Skip to content

Instantly share code, notes, and snippets.

@codylindley
Created March 30, 2011 18:45
Show Gist options
  • Save codylindley/894988 to your computer and use it in GitHub Desktop.
Save codylindley/894988 to your computer and use it in GitHub Desktop.
ie8 + <header> + jQuery = weird
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
<script src="http://ajax.cdnjs.com/ajax/libs/modernizr/1.7/modernizr-1.7.min.js"></script>
<style>header{height:100px}</style>
</head>
<body>
<header>test</header>
<script>
//should write 100 but writes 19 in ie8
document.write(jQuery('header').height())
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment