As the title says, I am looking for an efficient way to move a button when the mouse is moved over it (just for a little project I'm working on). I decided on using jQuery, but I am running into trouble with the code below. As it is syntactically correct (I believe), no errors are being thrown, but the button is not being moved as intended. Any help would be greatly appreciated, thanks.
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src = "jquery.js"></script>
<title>Click The Button!</title>
</head>
<body>
<input type="button" value="Try and Click Me!">
<script>
$("input").mouseenter(function(){
$(this).style.position = "absolute";
$(this).style.left = Math.floor(Math.random()*600)+"px";
$(this).style.top = Math.floor(Math.random()*400)+"px";
});
</script>
</body>
</html>
Obligatory edit to thank all those who replied for their correct responses! Much appreciated.