Showing posts with label Positive or Negative Number Checker in JQuery. Show all posts
Showing posts with label Positive or Negative Number Checker in JQuery. Show all posts

Sunday, June 30, 2019

Positive or Negative Number Checker in JQuery

A simple program that I wrote using JQuery to check for Positive or Negative Number.

If you like my work please click the ads on my website to support my work. I will really appreciate your help. 

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.

Here in Bacolod I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com


Program Listing

<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>
     
<button type= "button" id ="clear">Clear </button>
</form>
</body>
</html>