views:

21

answers:

1

Is It Possible to get the text box position using the javascript

+1  A: 

Here is the script

document.getElementById("<textboxId>").offsetTop

document.getElementById("<textboxId>").offsetLeft
Chinmayee
if i use the script it shows the error "document.getElementById("txtSentto45") is null"
Meena
Do you have textbox with id txtSentto45 in your page? [please check you might have txtSentto45 as text box name not id]
Chinmayee
Yes i had the textbox with the id "txtSentto45".Your Code is working Fine . if i run the code means i get replay 2 or 3 ,now i need the exact position .example top =322px. Is It possible
Meena

related questions