|
-
Mar 29th, 2001, 01:05 PM
#1
Thread Starter
Frenzied Member
Okay... let's play following the bouncing ball.
Code:
<div id='blueBall'>
Blue Ball
</div>
<div id='blueBall'>
Blue Ball
</div>
<div id='redBall'>
Red Ball
</div>
<input id='ballCount'>
<script language='JavaScript'>
function CountBall(ball) {
document.ballCount.value = ball.length;
}
</script>
<a href='javascript:void()' onclick='CountBall(blueBall)'>Count the Blue Ones</a>
<a href='javascript:void()' onclick='CountBall(redBall)'>Count the Red Ones</a>
Now, it counts 2 for the the blue balls but says undefined for the red ones.
Feces throwing monkeys.
Travis, Kung Foo Journeyman
As always, RTFM.
WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
YBMS, but Mozilla doesn't.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|