<html> <button onclick="runter()">runter</button> <img id="ball" width=50 height=50 style="position: absolute; left: 100; top: 50" src="https://cdn.shopify.com/s/files/1/0906/5342/products/NickLight_SoccerBall1.jpg?v=1497386076"> <button onclick="hoch()">hoch</button> <button onclick="rechts()">rechts</button> <button onclick="left()">links</button> </img> <script> y = 50 x=100 function runter() { y = y + 10 document.getElementById("ball").style = "position: absolute; left: "+x+"; top: "+y } function hoch() { y=y - 10 document.getElementById("ball").style = "position: absolute; left: "+x+"; top: "+y } function rechts() { x=x + 10 document.getElementById("ball").style = "position: absolute; left: "+x+"; top: "+y } function left() { x=x - 10 document.getElementById("ball").style = "position: absolute; left: "+x+"; top: "+y } </script> </html>
<!DOCTYPE html> <html> <title>Web Page Design</title> <head> <script> function sayHello() { document.write("Hello, Coding Ground!"); } sayHello(); /*var add = function() { var i, sum = 0; for (i=0; i< arguments.length; i++) { sum += arguments[i]; } return sum; } document.write("<br>" + add(1,2,3,4,4566)); function fibonacci(n) { var i = 1; var j = 1; var k = 0; document.write (i "<br>" ); document.write (j "<br>" ); for (a = 1, a <= n-2, a++){ k = j + i; i = j ; j = k; document.write(k + "<br>"); } } fibonacci(5); </script> </head> <body> </body> </html>
Unable to open file!