[latex]Mae govannen![/latex]
du solltest natürlich angeben, wo du die elemente zählen willst - wenn du document als "wurzel" angibst, ist klar, dass du alle bekommst
document.getElementById('meinelement').getElementsByTagName('span').length
und wenn 'meinelement' aus was für einem Grund auch immer nicht gefunden wird, stirbt das Script mit null.getElementsByTagName('span').length
~~~javascript
var elem;
if (typeof(elem = document.getElementById('meinelement')) == 'object') {
alert(elem.getElementsByTagName('span').length);
}
(Nur FF2, IE6 und OP9 getestet)
Cü,
Kai
--
Ash nazg durbatulûk, ash nazg gimbatul,ash nazg thrakatulûk, agh burzum-ishi krimpatul
Sacrifice - the future has it's price
And today is only yesterday's tomorrow
selfcode sh:( fo:| ch:? rl:( br:< n4:# ie:{ mo:| va:) js:) de:> zu:) fl:( ss:| ls:?
Ash nazg durbatulûk, ash nazg gimbatul,ash nazg thrakatulûk, agh burzum-ishi krimpatul
Sacrifice - the future has it's price
And today is only yesterday's tomorrow
selfcode sh:( fo:| ch:? rl:( br:< n4:# ie:{ mo:| va:) js:) de:> zu:) fl:( ss:| ls:?