+ 2
Whats wrong with this Code?
DOCTYPE html> <html> <head> <title>Page Title</title> </head> <body> <div id="container"> <div id="box"> </div> </div> <script>function move() { if(pos >= 150) { clearInterval(t); } else { pos += 1; box.style.left = pos+'px'; } move(); </script> <button id="btn"onclick=move() > Nochmal </button> </body> </html> SoloLearn throws an error at line 18 of the code(the closing script block). Please help me!
4 Respostas
+ 4
You missed a } for the move function and also pos is not defined.
+ 3
Thanks
+ 2
You forgot to put the closing curly bracket for move function
+ 2
1. Close the curly bracket
2. function pos not defined
3. It is highly reccomended to change line 1 to <! doctype html>
Bitteschön