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
精彩评论