Moving DIV element

  • Thread starter Thomas Scheiderich
  • Start date
T

Thomas Scheiderich

I am trying to get this section to move and I can't seem to get it to move.

When I click the words or image - it should move, but it isn't.

What am I missing?

*************************************************************
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<title></title>
</head>
<body>

<script language="javascript">
function moveObject()
{
alert("this is a test");
var object=document.getElementById('object1');
object.style.top=60 + 'px';
object.style.left=120 + 'px';
alert("this is a test2");

}
</script>

<div id="object1" onclick="moveObject()" >
This is a test<br><img src="msft_118x35.gif">
</div>
</body>
</html>
*********************************************************

Thanks,

Tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top