开发者

get current width of html form using javascript

开发者 https://www.devze.com 2023-01-19 02:20 出处:网络
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\">

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
0

精彩评论

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