Hello,
Recently when I was doing some testing, I found issue with length
property. The size() method returned correct value but the length
method returned incorrect value.
I used the mark up below to test my code.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Selector Demo 2</title>
<script type="text/javascript" src="jquery-1.3.1.js"></script>
<script>
$(document).ready(function(){
$('#btnNameAttr').click(function(e) {
$('#log').html('# of elements having attribute
[name] : '
+ $('[name]').length);
});
});
</script>
<style>
body { font-size:16px; font-weight:bolder; }
#main {
margin: 10px 10px;
}
</style>
</head>
<body>
<div>
<textarea rows="3" cols="50" id='log'></textarea>
</div>
<div class="top">
<div class="first second">
First
</div>
<div class="first second">
Second
</div>
<div class="first">
Third
</div>
<input type='text' name='textbox' />
<input type='hidden' name='hidden' />
<input type='hidden' name='hidden' sortorder='DE SC' />
<br />
<input type="button" id="btnNameAttr" value="$('[name]')" />
<input type="button" id="btnCustomAttr"
value="$('[sortorder]')" />
<input type="button" id="btnAttrValue" value="$('[sortorder=DE
SC]')" />
<input type="button" id="btnHiddenNameAttr" value="$
('[name=hidden]')" />
</div>
</body>
</html>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"jQuery Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---