[jQuery] Bug?
[jQuery] Bug?
Hi,
I have this simple html code:
--------------- Start of bugTest.html --------
<html>
<head>
<title> jQuery Testing </title>
<script src="jquery.js" type="text/javascript"></script>
<script type="text/javascript">
function doTest() {
alert( $('#mainContent').children().size() );
alert( $('#mainContent').children().not('#thePopup').size() );
alert(
$('#mainContent').children().not('#thePopup').not('div.calendar').size()
);
}
</script>
</head>
<body id='mainContent'>
<div class='whatever' id="fader">Fading away...</div>
<A href="#">Link</A>
<div class='whatever'>Hello world</div>
<form>
<select name='combo'>
<option value='1' selected="selected">Item 1</option>
<option value='2'>Item 2</option>
<option value='3'>Item 3</option>
<option value='4'>Item 4</option>
<option value='5'>Item 5</option>
</select>
</form>
<P><A href="#" onclick="doTest();">Do the test...</A></P>
<div id="thePopup" style="overflow: visible; opacity: 1; display: none;">
Whatever...
</div>
</body>
</html>
--------------- End of bugTest.html ----------
and when I click the 'Do the test...' link I get three alerts showing
me: 6, 5 and 3.
I wonder why the last is 3 and not 5 again. Since I don't have any DIV
that has a class of calendar.
Or I don't understand how (chained) not()'s work or this is a bug...
Can somebody clarify it for me?
Thanks for your time.
Geert.
--
http://www.fastmail.fm - Accessible with your email software
or over the web
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/