Metachecker.net
|
TrafficChecker.net
|
RankChecker.net
Learn Java Script Today
|
Over 5000 Free Fonts
|
Tutorials
|
Javascript Forum
|
Other Javascript Resources
|
Cheat Sheet
JavaScript Basics
Inserting Javascript
Complete Tutorial
Advance DHTML Tutorial
Script archive
Advanced Tutorials
Alert Scripts
Animation
Audio
Background Effects
Banner Ads
Browser Window
Buttons
Button Forms
Calculcators
Calendars
Clocks & Dates
Cookies
Cursor Effects
DHMTL Games
DHTML Miscellaneous
Equivalents
Forms
Games
IE4+ Scripts
IE5+ Scripts
Image Effects
Image Miscellaneous
Links & Buttons
Math Related
Messages Miscellaneous
Miscellaneous
Mouse Tricks
Navigation
Page Details
Password Protection
Pulldown Menus
Random Stuff
Scrolling
Status Bar
Text Animation
User Detail
User Info
Window Control
Percent of Increase
Enter two numbers and JavaScript will help you determine the percent of increase. This is a perfectly simple example of using a JavaScript return function. Check it out!
Enter the two numbers to determine the percent of increase:
to
The percentage of increase is
Insert into <HEAD>
<SCRIPT LANGUAGE="JavaScript"> <!-- Original: Joey Mornin (jmornin@gateway.net) --> <!-- Modified with permission by Ronnie T. Moore --> <!-- This script and many more are available free online at --> <!-- The JavaScript Source!! http://javascript.internet.com --> <!-- Begin function findIncrease(form) { var num1 = form.num1.value; var num2 = form.num2.value; return ((num2 - num1) / num1 * 100 + "%"); } // End --> </script>
Insert into <BODY>
<center> <form name=increaseform> Enter the two numbers to determine the percent of increase:<p> <input type=text name=num1 size=4> to <input type=text name=num2 size=4> <input type=button value="Solve" onClick="this.form.answer.value = findIncrease(this.form);"><p> The percentage of increase is <input type=text name=answer size=6> </form> </center>
Other Options