Here is the version two of my program to check if the given number in JavaScript is a positive or negative number.
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 in my website kindly contact me also in my email address also. Thank you.
I am currently accepting programming work, it project, school
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 in my website kindly contact me also in my email address also. Thank you.
My email address are the following jakerpomperada@gmail.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.
Sample Program Output
Program Listing
index.htm
<html>
<head>
<style>
body {
font-family:arial;
background-color:lightgreen;
font-size:24px;
font-weight:bold;
}
</style>
<script>
function num()
{
var no;
no=Number(document.getElementById("no_input").value);
if (no==0) {
alert("The given number " + no + " is positive number.");
document.getElementById("no_input").value="";
document.getElementById("no_input").focus();
}
else if (no>=1) {
alert("The given number " + no + " is positive number.");
document.getElementById("no_input").value="";
document.getElementById("no_input").focus();
}
else
{
alert("The given number " + no + " is negative number.");
document.getElementById("no_input").value="";
document.getElementById("no_input").focus();
}
}
</script>
</head>
<body>
<br>
<h2> Positive and Negative Number Checker </h2>
<br>
Enter any Number: <input id="no_input">
<button onclick="num()">Check</button></br></br>
</body>
</html>
No comments:
Post a Comment