Today is . Page created 01/08/06, updated 06/29/06

Chemistry Image Chemistry CalculatorChemical Calculator
Empirical Formula

Number of Moles of atoms (n) :
Mass of Element (m) :
Relative Atomic Mass (Ar) :
Molarity
Concentration of Solute (M) :
Amount of Solute (n) :
Volume of Solution (L) :
* *

U sing basic theory and this calculator, you can quickly find the answers to your chemistry stoichiometry equations.

W e have tested the code in IE6.0, Firefox1.0.7, Opera8.51, Netscape7.02, Netscape8.0.4 and AOL Explorer1.2. This script worked well in all platforms with no variations observed.

D epending on your knowledge of HTML and javascripts, this is an easy four ( 4 ) part copy and paste code that goes in both the <HEAD> and <BODY> sections of your document. The first part is a copy and paste into a notepad*, and make into an external .js script. The second part is to upload the .js script that is called chemCalc.js into your directory. If you are unsure or need a refresher on howto make an "External JavaScript File", grab the below link and we have a step by step tutorial on howto.
Howto Make An External JavaScript File ]

* Note Of Importance Note of Importance ~ In reference to the external .js file that needs to be copied, and pasted into a "Notepad" and uploaded into your editor, remember this:

Once you need to paste and "Save As", you should use the Microsoft® Notepad. If you have a Notepad replacement and not using the Microsoft® Notepad, this Will Not Work!. You Need To Save it with the Microsoft® Notepad. Reason being is quite simple. Not everyone is using the notepad replacement you are. And by uploading it in the replacement, not all systems will be able to read the external Javascript. The notepad replacement is software that is installed on the individual system (computer). Not all systems will have the installed software for the replacement notepad you may be using. (it is a good bet though that just about every system does have the Microsoft® Notepad). This means your system will not be able to read it and the effect will not work.

O nce you have the .js (this one will be called chemCalc.js) file made and uploaded into the same directory* as the effect will be located, now you need to paste the below snipplet of code into the <HEAD> section of your document.

<script type="text/javascript" src="chemCalc.js"></script>

T he above little code is what calls the "External JavaScript File" you have created.

* In reference to uploading the .js file into the same directory. If you select to upload it into a different directory, then you must reconfigure the path to reflect where the .js script will be called. If this is slightly unclear, grab the below link and it is completely explained on howto upload the .js script into a different directory.
Upload .js File To Different Directory ]

T he fouth or last part of the code goes anywhere in the <BODY> section of your document where you want the calculator to appear. The only reconfigurations to this part are cosmetic. Just study this part to see where you want to change the font color, style, etc.

* *T he last thing we shall cover which is not part of the script is the little form button (Instructions) just below the calculator. The default script has the instructions above the calculator. If you would prefer to have the instructions just below with the form button, see below on where and howto add this into the effect.

Default With Text on Top Of Effect

<!-- Paste this code into the BODY section of your HTML document -->

<p>Using basic theory and this calculator, you can quickly find the answers to your chemistry stoichiometry equations.</p>

<p><strong>Instructions</strong>
Fill in any two of the three text fields in either the empirical formula or the molarity forms. (Make sure at least one of the three text fields are empty.)

<strong>Empirical Formula</strong>
<form name="form" action='#top'>'

Part Of The <BODY> Section Of Code Goes Here

      <td></td>
      <td><input type="button" value="Calculate" onclick="CVA()" />
      <input type="button" value="Clear" onclick="clear2()" /></td>
    </tr>
  </table>
</form>

Reconfigured With Form Button Implimented

<!-- Paste this code into the BODY section of your HTML document -->

<!------ Remove Text From This Point Down ------>

<p>Using basic theory and this calculator, you can quickly find the answers to your chemistry stoichiometry equations.</p>

<p><strong>Instructions</strong>
Fill in any two of the three text fields in either the empirical formula or the molarity forms. (Make sure at least one of the three text fields are empty.)

<!------ Remove Text From This Point Up ------>

<strong>Empirical Formula</strong>
<form name="form" action='#top'>'

Part Of The <BODY> Section Of Code Goes Here

      <td></td>
      <td><input type="button" value="Calculate" onclick="CVA()" />
      <input type="button" value="Clear" onclick="clear2()" /></td>
    </tr>
  </table>

<!------ Start Copy For Form Button Of Instructions ------>

<input type="button" onClick="alert('Fill in any two of the three text fields in either the empirical formula or the molarity forms. (Make sure at least one of the three text fields are empty.)')"
Value="Instructions">

<!------ End Copy For Form Button Of Instructions ------>
</form>

I n actuality, all we did was to insert the form button with the instructions minus the opening <form> and closing <form> tags (reason being is this script is comprised of a form) and after the closing </table> and before the scripts closing </form> tag.
So...... If you want to add the little form button for the instructions, just copy and paste the above into the script as we did.

W e hope our tutorial was easy to follow and we covered everything in detail. If you would like to add this effect into your pages, grab the respective below link and you are there. If you have any problems with this or anything else, feel free to consult our FAQ ] and if you can't find the answer there, contact us ].
Get Code Here ]   [ Rate This Page ]