-4

This is sample code.

html div id="test" div form elements like uname and pwd 1st div end

2nd div end For the child div there is no nameor id.

Var

x=document.getElementById("test");
</html>

It is returning object but i was unable to print values..i was unable to find length of object. In IE11.

Please help on this.

Jens
  • 67,715
  • 15
  • 98
  • 113
Naveen K
  • 65
  • 2
  • 4
  • 11
  • _“i was unable to find length of object”_ – you have a reference to an HTML element here, and those don’t have a “length.” – CBroe Jan 14 '16 at 18:08

1 Answers1

0

Hopefully this works for your scenario:

x=document.getElementById("test");

var a = x.length;

console.log(a);
Korgrue
  • 3,430
  • 1
  • 13
  • 20