The Little Guy Posted August 12, 2008 Share Posted August 12, 2008 How come with this code, my alert is blank? the element dragger does exist too. var width = document.getElementById('dragger').style.width; alert(width); Quote Link to comment Share on other sites More sharing options...
lemmin Posted August 12, 2008 Share Posted August 12, 2008 Because the width was never set. Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted August 12, 2008 Author Share Posted August 12, 2008 It is set in my CSS, any who, I found out how: var width = document.getElementById('dragger').clientWidth; var height = document.getElementById('dragger').clientHeight; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.