Find (x, y) or (top, left) location of a textbox or button using jquery
2 answers
See jQuery Offset . It gets the current offset of the matched element, in pixels, relative to the document.
var textbox = jQuery("#element");
var offset = textbox.offset();
console.log("left: " + offset.left + ", top: " + offset.top );
See also: selector / text and selector / button
Use Firebug . It also adds a global variable named "console" to all web pages loaded in Firefox. In this case, "console.log" writes a message to the console.
+4
source to share