开发者

get position of a textbox on my form in px

开发者 https://www.devze.com 2023-01-15 20:05 出处:网络
Hi I want to set the position of anew div box relative to the position开发者_如何学Python of the comments box on my form. I can position the div but am struggling to get the value of the text box. I w

Hi I want to set the position of anew div box relative to the position开发者_如何学Python of the comments box on my form. I can position the div but am struggling to get the value of the text box. I was thinking this would work but it doesn't

pos = document.getElementById('comments').style.top.value 

any help please ?


Try

pos = document.getElementById('comments').offsetTop

0

精彩评论

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

关注公众号