usingMaths.com
Demonstrating and showing pupils and students one application of Mathematics.







<< PreviousNext >>

Collecting input for H.C.F. (G.C.D.) Code in JavaScript



Collecting Input in JavaScript.

Let's add some input mechanism so our user enters the set of numbers whose H.C.F. (G.C.D.) we are to find.


The JavaScript H.C.F. (G.C.D.) code

The code follows the same steps as that from the previous lessons.
We just adapted the HCF.html

How to use the code

The user gets to enter his/her choice of numbers.
After entering each number, the user clicks the Next Number! button to enter his/her number.
After the user enters his/her last number, with the last number still in the text box, the user clicks the Find H.C.F. button.

Create 1 new file; On Notepad++: File, New.
Call them HCFInput.html
Type out the adjoining JavaScript code for collecting input for H.C.F. (G.C.D.).










<< PreviousNext >>