'************************************** ' Name: Positive and Negative Number Che ' cker in JQuery ' Description:Here is a very simple prog ' ram that I wrote using JQuery that will ' ask the user to give a number and then o ' ur program will check and determine whet ' her the given number is a positive numbe ' r or negative number using JQuery as our ' JavaScript library. Add me at Facebook my address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com. My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com. My mobile number here in the Philippines is 09173084360. ' By: Jake R. Pomperada ' ' ' Inputs:None ' ' Returns:None ' 'Assumes:None ' 'Side Effects:None '************************************** <html> <head> <title> Positive or Negative Number Checker in JQuery </title> <script src="jquery.js"></script> <style> body { font-family: arial; font-size:15px; font-weight:bold; } .input_bold { font-weight: bold; font-size:15px; color: red; } </style> <script> $(document).ready(function(){ $("#check_it").click(function(){ var num = $("#num_value").val(); if(jQuery.isNumeric(num) == false){ alert('Please enter numeric value'); $('#num_value').val(''); $("#results").val(''); $('#num_value').focus(); } else if (num>= 0) { remarks = num+ " is a Positive Number."; ' $("#results").val(remarks); } else { remarks = num+ " is a Negative Number."; ' $("#results").val(remarks); } }); $("#clear").click(function(){ $("#num_value").val(''); $("#results").val(''); $("#num_value").focus(); }); }); </script> </head> <body> <form> Give a Number <input type="text" id="num_value" size="3"autofocus/><br><br> The result <input type="text" id="results" class="input_bold" size="30" readonly/><br> <br><br> <button type= "button" id ="check_it">Check </button> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <button type= "button" id ="clear">Clear </button> </form> </body> </html>