Friday, June 22, 2018

javascript - Element destination





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.


Answer



Try this:



window.onload = function() {

console.log(document.getElementById("id1").offsetTop);
};


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


No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...