Hi,
Hi, wie der Titel schon sagt:
<div>
<p>
<input type="file" name="file_ar[]" />
<button onclick="alert(this.parentNode.lastChild.nodeName);">TEST</button>
<h5>rgreg</h5>
</p>
</div>
Auch Whitespace zwischen Tags stellt Knoten dar - und das wissen auch alle Browser, ausser dem IE.
> Während das ganze Beispiel mit firstChild problemlos funktioniert:
>
> ~~~javascript
> <div>
> <p>
> <input type="file" name="file_ar[]" />
> <button onclick="alert(this.parentNode.firstChild.nodeName);">TEST</button>
> <h5>rgreg</h5>
> </p>
> </div>
>
Dürfte es eigentlich nicht, denn auch das fristChild ist im gezeigten Falle ein Textknoten.
MfG ChrisB
--
Light travels faster than sound - that's why most people appear bright until you hear them speak.
Light travels faster than sound - that's why most people appear bright until you hear them speak.