Jump to content

Jaws

Members
  • Posts

    5
  • Joined

  • Last visited

Jaws's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. i have this and i want it to check if both of them are true it comes up with yes, but if only one of them are true then i want it to come up as no. var n = 12; var m = 12; function myFunction() { if (n < 10,m != 20) { alert ("Yes"); } else { alert ("no"); } }
  2. Thanks for the help i got there in the end!
  3. function (myFunction)() did you mean this?
  4. 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>
×
×
  • Create New...