nntp2http.com
Posting
Suche
Optionen
Hilfe & Kontakt

javascirpt Problem ?!

Von: UnTo (thomas.unzeitig@gmail.com) [Profil]
Datum: 03.10.2009 21:45
Message-ID: <c36fcc11-d0c7-4821-92d3-da7a2b68d1cf@q14g2000vbi.googlegroups.com>
Newsgroup: de.comp.lang.javascript
Kann mir wer sagen warum das untere Script einmal DIV und dann
"undefined" bringt ?!

<html>
<head>
<script type="text/javascript">
function go2(x)
{
alert(x.parentElement.firstChild.tagName);
alert(x.parentElement.lastChild.tagName);
}
</script>
</head>
<body>
<div>
<div onclick="javascript:go2(this);">This is a DIV</div>
<input type="text" />
</div>
</body>
</html>

[ Auf dieses Posting antworten ]

Antworten