开发者

get position of a textbox on my form in px

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜