nextsibiling doesn't work
<p>this is a sample code of what I am doing. unfortunately the alert(nextElem.value) returns "undefined" when I click the second checkbox to get the href of the link after it. do you have any idea how to fix it?</p>

<pre><code>   &lt;HTML&gt;
&lt;HEAD&gt;
&lt;TITLE&gt;Checkbox Inspector&lt;/TITLE&gt;
&lt;SCRIPT LANGUAGE="JavaScript"&gt;

function validate()
{
    for (i = 0; i &lt;(document.f1.checkThis.length) ; i++) {
        if (document.f1.checkThis[i].checked) {
            var elem = document.f1.checkThis[i];
            var nextElem = elem.nextSibling; 
            alert(nextElem.href);
            }
        }
}
&lt;/SCRIPT&gt;
&lt;/HEAD&gt;
&lt;BODY&gt;
&lt;FORM name="f1"&gt;
&lt;INPUT TYPE="checkbox" NAME="checkThis" value="http://www.google.com" onClick="validate()"&gt;Check here&lt;BR&gt;
&lt;a href="http://www.google.com"&gt;click here&lt;/a&gt;    
&lt;/FORM&gt;
&lt;/BODY&gt;
&lt;/HTML&gt;
</code></pre>
