开发者

How to get div height value in JavaScript or jQuery?

I need to get a div's height in JavaScript or jQuery and change it's value in CSS.

How could I do this in jQuery or JavaScrip开发者_如何学Ct?


This should accomplish what you need

var height = $(selector).height();

and you set it like this

$(selector).height(val);


Pretty standard javascript.

var divHeight = document.getElementById("yourDiv").style.height
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜