I have been trying to write a java scrip that will move an image (image1) to the pixel location that the user inputs into a text box. here is what i have so far:
<script type="text/javascript"
language="javascript">
//I set temporary variables
var tempX = 0
var tempY = 0
function moveTo(x,y) {
document.getElementById("image1")
.style.left=x;
document.getElementById("image1")
.style.top=y;
}
</script>
<input type="button" value="Go!"
onclick="javascript:moveTo(document.getElementById("TempX"),document.getElementById("Tempy"))">
<img id="image1" src="image1.png"
style="position:absolute;
left:200px; top:200px;
width:100px; height:100px;
z-index:0"
alt="" title="">
</script>
<input type="text" id="X" value="0" size="4"> X<br>
<input type="text" id="Y" value="0" size="4"> Y<br>
__________________________________________-
Please help me fix this code. i am not sure if the problem is in the variables or setting the variables based on the numbers in the text box. Please help me fix this scrip.