我有一個div:訪問div的高度在JavaScript
CSS
div { width: 200px; height:auto }
標記
<div contenteditable="true"> Text is editable </div>
現在我應該怎麼做才能訪問的的height (numeric value)
以上div在JavaScript?我試過
$('div').height()
& $('div').css("height");
兩者都返回auto
。
兩者都很好http://jsfiddle.net/sySFk/ – Musa 2012-07-16 08:06:10