get current width of html form using javascript
I want to get the current width of an html form using javascript. I'm writing this in asp.net
Form definition: <form id="form1" runat="server">
What I an trying: document.getElementById('form1').style.width
Keep producing a 开发者_StackOverflow中文版runtime error... Any ideas?
Thanks!
Have you tried this: document.body.clientWidth
?
Try this
document.getElementById('form1').offsetWidth
精彩评论