Combining the H.C.F. (G.C.D.) JavaScript Code and Collecting User Input
The code follows the same steps as that from the previous lessons.
We just adapted the HCF.html
How to use the HCF Code in JavaScript
The user gets to enter his/her choice of numbers for the HCF JavaScript algorithm.
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.).
So! JavaScript Fun Practice Exercise - Find HCF with User Input
As a fun practice exercise, feel free to try out your own numbers,
and see how the JavaScript code finds the HCF of your input numbers.