0

How to get the height of a div and store into a variable?

.top {
    content:url(../images/top480.jpg);
    z-index:0;
    border-bottom:1px solid #000000;
    width:100%;
}
/* The weight is variable, is not fixed*/

I am trying something like this:

var hou = $(".top").width();
window.alert(hou);
Trupe
  • 1
  • 3
  • Possible duplicate of [Get div height with plain JavaScript](http://stackoverflow.com/questions/15615552/get-div-height-with-plain-javascript) – timolawl May 07 '16 at 00:21

1 Answers1

0

You can use $(".top").height();

Is that what you are looking for?

James Hamann
  • 842
  • 6
  • 12