帮你写了一个简单的例子,自己参考一下
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<script>
function moves()
{
if(document.getElementById("mq").direction=="left")
{
document.getElementById("mq").direction="right";
}
else
{
document.getElementById("mq").direction="left";
}
}
</script>
<body>
<input type="button" name="Submit" value="left" onClick="moves()">
<marquee dir="ltr" direction="left" id="mq">fsdfsf</marquee>
<input type="button" name="Submit2" value="right" onClick="moves()">
</body>
</html>