Hi.

I am trying to use javascript to change the direction of a marquee when a button is clicked. It should be simple, as I am able to change other things, for example the text that is displayed (.innerHTML = "othertext") however changing the 'direction' or 'scrollamount' (speed) parameters doesnt do anything. Not even give an error in IE. (Also tried in firefox). I know parameters can be changed using this method, as I am able to change the .value of the button for example.

The code used/not working is below;

<html>
<head>
<script>
function myfunction(obj)
{

obj.scrollamount = 99;

}
</script>
</head>

<body>
<form>
<input type="button" value="Click" id="mybutton" onclick="myfunction(document.getElementById('mymarquee'));">
</form>

<marquee id="mymarquee" direction="right" scrollamount="1">some text</marquee>

</body>
</html>

Any ideas?
Thanks!

    Write a Reply...