JavaScript get child element

后端 未结 3 1941
梦谈多话
梦谈多话 2020-12-13 08:56

Why this does not work in firefox i try to select the category and then make subcategory visible.



        
3条回答
  •  借酒劲吻你
    2020-12-13 09:36

    ULs don't have a name attribute, but you can reference the ul by tag name.

    Try replacing line 3 in your script with this:

    var sub = cat.getElementsByTagName("UL");
    

提交回复
热议问题