<html>
<head>
<style> # ball
Position: absolute;
{top:4;
Left: 200;
Width: 16;
Height: 16; }
</style>
</head>
Image – width: 300;
<script type = “text/javascript”>
Var v = prompt (“enter vertical position”);
Ball.style.top=v;
</script>
Document.get element by id (“ball”);
Document. on Keydown = key listener;
Function key listener (e)
{if (!e)
{ e = window.event;}
If (e.key code= = 37){ ball style. Top t=2;
<body>
<div id=”ball”>
<img src=”ball.gif”>
</div>
</body>
</html>
Help appreciated. Thank you.
This was written on the board by a teacher and I can't get it to work.
I am a Teachers Aide and the teacher couldn't get this code to work either. We spent the whole lesson trying, with the students trying as well.
Also, I thought there should be a type specified for <style> ?
It has been copied exactly from the board - as the teacher wrote it.
Thank you for your help Colanth - I thought the javascript should be within those tags. This is what I now have, but still it won't preview as expected.
<html>
<head>
<style> # ball
Position: absolute;
{top:4;
Left: 200;
Width: 16;
Height: 16;
Image-width: 300}
</style>
</head>
<script type = “text/javascript”>
Var v = prompt (“enter vertical position”);
Ball.style.top=v;
Document.get element by id (“ball”);
Document. on Keydown = key listener;
Function key listener (e)
{if (!e)
{ e = window.event;}
If (e.key code = = 37){ ball style. Top t=2;
</script>
<body>
<div id=”ball”>
<img src=”ball.gif”>
</div>
</body>
</html>
I do have the ball.gif in this folder, but still can't see it.
<head>
<style> # ball
Position: absolute;
{top:4;
Left: 200;
Width: 16;
Height: 16; }
</style>
</head>
Image – width: 300;
<script type = “text/javascript”>
Var v = prompt (“enter vertical position”);
Ball.style.top=v;
</script>
Document.get element by id (“ball”);
Document. on Keydown = key listener;
Function key listener (e)
{if (!e)
{ e = window.event;}
If (e.key code= = 37){ ball style. Top t=2;
<body>
<div id=”ball”>
<img src=”ball.gif”>
</div>
</body>
</html>
Help appreciated. Thank you.
This was written on the board by a teacher and I can't get it to work.
I am a Teachers Aide and the teacher couldn't get this code to work either. We spent the whole lesson trying, with the students trying as well.
Also, I thought there should be a type specified for <style> ?
It has been copied exactly from the board - as the teacher wrote it.
Thank you for your help Colanth - I thought the javascript should be within those tags. This is what I now have, but still it won't preview as expected.
<html>
<head>
<style> # ball
Position: absolute;
{top:4;
Left: 200;
Width: 16;
Height: 16;
Image-width: 300}
</style>
</head>
<script type = “text/javascript”>
Var v = prompt (“enter vertical position”);
Ball.style.top=v;
Document.get element by id (“ball”);
Document. on Keydown = key listener;
Function key listener (e)
{if (!e)
{ e = window.event;}
If (e.key code = = 37){ ball style. Top t=2;
</script>
<body>
<div id=”ball”>
<img src=”ball.gif”>
</div>
</body>
</html>
I do have the ball.gif in this folder, but still can't see it.