Hi All, new to Javascript and stuck on a small issue, its a little late and my head is not thinking straight.
The scenerio is I have two textboxes and a submit button. All i want is the values to transfer to a function so i can change 2 global variables. I have managed to 'document.write the values from the function, but cant seem to do anything else with them. Below is the code
var Jspeed=200; //Global variables that I want to change
var CSpeed=200;
function changeSpeed(ClownSpeed, JuggleSpeed) {
ClownSpeed = Cspeed;
JuggleSpeed = Jspeed;
}
<form>
<p id="controlText">Enter Clown Speed: </p> <input type="text" id="ClownSpeed" > <br />
<p id="controlText">Enter Juggle Speed:</p> <input type="text" id="JuggleSpeed">
<button type="button" onclick="changeSpeed(ClownSpeed, JuggleSpeed);" >Change Speed</button>
</form>
I would also like to know if this is the right apporoach to things. Im new to this so I would like to keep it as simple as possible.
Thanks to all in advance!
Ryan