我该如何解决这个练习?

时间:2010-02-07 14:33:19

标签: javascript xml dom

这是xml代码,我想用javascript编写代码,使用DOM获取父亲,母亲,女儿和儿子的名字------->(ali,mona,ghada和mohamed)

任何人都可以帮助我吗?

<family>
    <grandfather>Ibrahim
            <father job="Engineer">Ali
                 <mother>mona</mother>
                 <daughter age="23" job="ITI student">ghada</daughter>
                 <son age="21" sport="football">mohamed</son>
            </father>
         <uncle>Alaa</uncle>
         <uncle>reda</uncle>
         <aunt sons="2">layla</aunt>
    </grandfather>
</family>

1 个答案:

答案 0 :(得分:1)

查看thisthis