Advertisement
svetoslavbozov

[JS] Operators and Expressions 6

Mar 13th, 2013
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <html>
  2. <head>
  3. <title></title>
  4. <link href="styles/js-console.css" rel="stylesheet" />
  5. </head>
  6. <body>
  7.     <div id="js-console">
  8.         <div>
  9.             <label>Enter X: </label>
  10.             <input type="text" id="xCoord"/>                
  11.         </div>
  12.         <div>
  13.             <label>Enter Y: </label>
  14.             <input type="text" id="yCoord"/>                
  15.         </div>
  16.         <div>
  17.             <label>Is the point in the K(0,5): </label>
  18.             <input type="button" Value="Check" onclick="IsInCircle()"/>
  19.         </div>
  20.     </div>
  21.     <script src="scripts/js-console.js">   
  22.     </script>  
  23.     <script>
  24.         function IsInCircle() {
  25.         var x = jsConsole.readFloat("#xCoord");
  26.         var y = jsConsole.readFloat("#yCoord");
  27.  
  28.         jsConsole.writeLine((x * x) + (y * y) < 25 ? "True" : "False");
  29.         }  
  30. </script>  
  31. </body>
  32. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement