1

I created a html page and inserted a textbox. I would like to know a textbox destination in the page from javascript function? Example textbox's top is 100 px like that. Thank you.

zanhtet
  • 2,040
  • 7
  • 33
  • 58

1 Answers1

1

Try this:

window.onload = function() {
    console.log(document.getElementById("id1").offsetTop);
};

where id1 is the id of the textbox you need to triangulate.

ATOzTOA
  • 34,814
  • 22
  • 96
  • 117