More SVG questions (and Javascript) - Interactivity [moving a rectangle] -
The following code should be rectangularized while pressing WASD keys on the keyboard. This does not work, the rectangle is not transferred, but no error occurs. How can I do this work? & lt ;? Xml version = "1.0" encoding = "UTF-8" standalone = "no"? & Gt; & Lt ;! DOCTYPE svg PUBLIC "- // W3C / DTD SVG 1.1 / n" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> & Lt; Svg width = "90%" height = "90%" version = "1.1" xmlns = "http://www.w3.org/2000/svg" & gt; & Lt; Script type = "text / javascript" & gt; & Lt ;! [CDATA [var x; Var y; Function moves () {x = new number (document.getElementById ("player").); Y = new number (document.getElementById ("player"). Y); Switch (event.keyCode) {Case 119: y--; Document.getElementById ("player") y = y break; Case 115: y ++; Document.getElementById ("player") y = y break...