<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Untitled Page</title> <script src="http://code.jquery.com/jquery-latest.js" type="text/javascript"></script> </head> <body> <form action=""> <input type="button" id="placeit" value="placeit" name="btn2" /> <input id="btn1" type="button" name="btn1" value="button" /> <p> </p> </form> <script type="text/javascript"> var p = $("#btn1"); var position = p.position(); var place = document.getElementById("placeit"); place.top = position.top + 30; place.left = position.left; alert(place.top); alert(place.left); $("p:last").text("left: " + position.left + ", top: " + position.top); </script> </body> </html>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)