Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Where to start making a Javascript Diabestes Risk Calculator Reply To: Where to start making a Javascript Diabestes Risk Calculator

#158743
nkrisc
Participant

Based on the limited information provided, I can tell you with some confidence you will probably need to use arrays, functions, and IF statements.

How is risk calculated based on the their responses? Do you just need to add up all the corresponding values? Is it weighted? Where’s your HTML?

document.getElementById("age") will return that element from the DOM, but what do you want to do with it? I’m guessing you want its value.

var age = document.getElementById("age").value

Once you have that variable, what do you want to do with it? Multiply it times a billion?