<p>In Javascript:
How does one find the coordinates (x, y, height, width) of every link in a webpage?</p>

[{'answer_id': 67642, 'author': 'Jim', 'author_id': 8427, 'author_profile': 'https://Stackoverflow.com/users/8427', 'pm_score': 3, 'selected': True, 'text': '<p>Using jQuery, it\'s as simple as:</p>\n\n<pre><code>$("a").each(function() {\n    var link = $(this);\n    var top = link.offset().top;\n    var left = link.offset().left;\n    var width = link.offset.width();\n    var height = link.offset.height();\n});\n</code></pre>\n'}, {'answer_id': 67674, 'author': 'Peter Boughton', 'author_id': 9360, 'author_profile': 'https://Stackoverflow.com/users/9360', 'pm_score': 0, 'selected': False, 'text': "<p>With jQuery:</p>\n\n<pre><code>$j('a').each( findOffset );\n\nfunction findOffset()\n{\n    alert\n    ( 'x=' + $j(this).offset().left\n    + ' y=' + $j(this).offset().top\n    + ' width=' + $j(this).width()\n    + ' height=' + $j(this).height()\n    );\n}\n</code></pre>\n"}, {'answer_id': 68073, 'author': 'HFLW', 'author_id': 252822, 'author_profile': 'https://Stackoverflow.com/users/252822', 'pm_score': 2, 'selected': False, 'text': '<p>without jquery:</p>\n\n<pre><code>var links = document.getElementsByTagName("a");\nfor(var i in links) {\n    var link = links[i];\n    console.log(link.offsetWidth, link.offsetHeight);\n}\n</code></pre>\n\n<p>try this page for a func to get the x and y values:\n<a href="http://blogs.korzh.com/progtips/2008/05/28/absolute-coordinates-of-dom-element-within-document.html" rel="nofollow noreferrer">http://blogs.korzh.com/progtips/2008/05/28/absolute-coordinates-of-dom-element-within-document.html</a></p>\n\n<p>However, if you\'re trying to add an image or something similar, I\'d suggest using the a:after css selector.</p>\n'}, {'answer_id': 33945031, 'author': 'Jonatas Walker', 'author_id': 4640499, 'author_profile': 'https://Stackoverflow.com/users/4640499', 'pm_score': 1, 'selected': False, 'text': "<p>Plain JavaScript:</p>\n\n<pre><code>function getAllChildren (node, tag) {\n  return [].slice.call(node.getElementsByTagName(tag));\n}\nfunction offset(element){\n  var rect = element.getBoundingClientRect();\n  var docEl = doc.documentElement;\n  return {\n    left: rect.left + window.pageXOffset - docEl.clientLeft,\n    top: rect.top + window.pageYOffset - docEl.clientTop,\n    width: element.offsetWidth,\n    height: element.offsetHeight\n  };\n}\n\nvar links = getAllChildren(document.body, 'a');\nlinks.forEach(function(link){\n  var offset_node = offset(node);\n  console.info(offset_node);\n});\n</code></pre>\n"}]
['https://Stackoverflow.com/questions/67612', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/401774/']