Ho il seguente codice HTML:
e il seguente codice javascript:<form id="registration" action="/cgi-bin/registration.cgi" method="POST" onsubmit="return control()">
<fieldset>
<legend>Legend 1</legend>
<label>......</label> <input ..../>
<label>......</label> <input ....onclick="return orgreg()"/>
</fieldset>
<fieldset>
<legend>Legend 2</legend>
<label>......</label> <input ..../>
<label>......</label> <input ..../>
<label>......</label> <input ..../>
<label>......</label> <input ..../>
<label>......</label> <input ..../>
</fieldset>
........
........
L'output di questa finestra di alert è:[Object Text]function orgreg() {
if (document.getElementById) {
alert(document.getElementById("registration").firs tChild);
}
}
Ora il primo figlio si riferisce al primo tag fieldset, giusto? ...e non al tag legend?
[/QUOTE]