get height of dom element after using get(index)

122 Views Asked by At

I use the following (not working code):

var height = $("#rows").children().get(index).height(); 

The thing is that .get(index) returns the DOM element. So after that the height() method does not exist.

How can I work around this problem?

1

There are 1 best solutions below

0
On BEST ANSWER

use eq()

var height = $("#rows").children().eq(index).height();

or

var height = $("#rows").children().get(index).clientHeight;

NOTE: get() will be converted to javascript object so there is no height() method in javascript