Kinda new to java and this website ofc.Been doing a few exercises and i am not sure why this is not working :(Help much appreciated Edit: forgot to add that i am trying to make the program check what number it is and then bring up a alert box with 1 of 2 outcomes
body><canvas id="canvas1" width="640" height="480" ></canvas> <script type="text/javascript"> // turn the html5 canvas into something we can edit in javascript (call it myCanvas)... var myCanvas = (document.getElementById("canvas1")); // take a 2d context from the canvas (call it myContext)... var myContext = (myCanvas.getContext("2d")); // when we do drawing stuff, we do it to the context, not the canvas... myContext.strokeRect(0,0,640,480); myContext.fillText("hello", 20, 20); function myFunction() var n = 6; if (n <= 5) { alert ("Yes"); } else { alert ("NO"); } </script> <input type="button" onclick="myFunction()" value="Show alert box" /></body></html>