Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. How to get element.children.length in Firefox

How to get element.children.length in Firefox

Scheduled Pinned Locked Moved Web Development
javascriptcomtoolshelptutorial
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sachin Pimpale
    wrote on last edited by
    #1

    Hi all i have created table I want to get length of its element using javascript in Firefox but it gives error as element.children is undefined

    var element = document.getElementById("tableMenu");
    var elelen;
    elelen = element.children.length

    The Stifler -- Bugs can neither be created nor be removed from software by a developer. They can only be converted from one form to another. The total number of bugs in the software always remain constant.

    S 1 Reply Last reply
    0
    • S Sachin Pimpale

      Hi all i have created table I want to get length of its element using javascript in Firefox but it gives error as element.children is undefined

      var element = document.getElementById("tableMenu");
      var elelen;
      elelen = element.children.length

      The Stifler -- Bugs can neither be created nor be removed from software by a developer. They can only be converted from one form to another. The total number of bugs in the software always remain constant.

      S Offline
      S Offline
      Shog9 0
      wrote on last edited by
      #2

      Use element.childNodes instead. Be aware, unlike element.children this list may contain text nodes.

      ----

      You're right. These facts that you've laid out totally contradict the wild ramblings that I pulled off the back of cornflakes packets.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups