Skip to main content

Bug Tracker

Side navigation

Ticket #5661: section.html

File section.html, 1.2 KB (added by tonydewan, December 15, 2009 03:19PM UTC)

All necessary code to recreate bug

<!DOCTYPE html>
	<meta charset="utf-8">
	<title>jQuery + Modernizr + &lt;section&gt; + IE7 = :( </title>
<script src="modernizr-1.0.min.js" type="text/javascript" charset="utf-8"></script>
<script src=""></script>

<style type="text/css" media="screen">
		display: block;
		border: 1px solid #ddd;
		margin: 20px;}
		background: #eee;
		padding: 10px;
		border: 1px solid #ddd;}

<script type="text/javascript">
		var sections = $('section').length;
		var children = $('section *').length;
		var paragraph= $('section p').length;
		$('<p/>').html('jQuery reports that there are '+sections+' <em>sections</em> with '+children+' total <em>children</em>, '+paragraph+' of which are <em>paragraphs</em>').appendTo('#results');
	<div id="results">
		<p>There are be 2 <em>sections</em> with 7 total <em>children</em>, 5 of which are <em>paragraphs</em></p>
	<section class="first">
		<h3>I am A Section!</h3>
		<p>Child 1</p>
		<p>Child 2</p>
		<p>Child 3</p>

		<h3>Me too!</h3>
		<p>Child 2</p>
		<p>Child 3</p>

Download in other formats:

Original Format