Not signed in (Sign In)

SkillShare - A place to discuss Web Standards and Web Design topics

Categories

Vanilla 1.1.9 is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthorpkevil
    • CommentTimeAug 17th 2006
     permalink
    my html code
    <ul>
    <li><a href="javascript:myfunc('aaa')">xxx</a><li>
    <ul id="aaa">
    <li></li>
    </ul>
    <li><a>xxx</a><li>
    <ul>
    <li></li>
    </ul>
    </ul>

    function myfunc(a){
    var a=getElementById('a');
    var b=a.parentNode.childNodes;
    for(var i=0;i<b.length;i++){
    alert(b[i].nodeName);
    }

    i didn't understand it alert A,#TEXT,#UL
    i thought i should alert LI UL LI UL

    WHY....?
    }
    • CommentAuthorPettyRider
    • CommentTimeAug 17th 2006
     permalink
    For starters, that XHMTL is pretty whacky.
    •  
      CommentAuthornifkin
    • CommentTimeAug 18th 2006
     permalink
    yeah, i'll second PettyRider, if yr not starting from valid X/HTML then trying to use the DOM is going to be a crapshoot.
Add your comments
    Username Password
  • Format comments as (Help)