Friday 22 June 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

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...