Please could you help me get the if statements in my javascript working?
Also i have put a link to a new page in my message variables, but i don't think it's quite right, any help on this would also be appreciated.
var messageLow = "Your results show that you currently have a low risk of developing diabetes. However, it is important that you maintain a healthy lifestyle in terms of diet and exercise.";
var messageMed = "Your results show that you currently have a medium risk of developing diabetes. For more information on your risk factors, and what to do about them, please visit our diabetes advice website at http://www.zha.org.zd/";
var messageHigh1 = "Your results show that you currently have a HIGH risk of developing diabetes. Your main risk factors are your age and your BMI. We advise that you contact the Health Authority to discuss your risk factors as soon as you can. Please fill in our contact form and a member of the Health Authority Diabetes Team will be in contact with you.";
"Please click on this link to fill out a contact form:" <a href=contactForm.html>contact form</a>
var messageHigh2 = "Your results show that you currently have a HIGH risk of developing diabetes. Your main risk factors are your age and your family history. We advise that you contact the Health Authority to discuss your risk factors as soon as you can. Please fill in our contact form and a member of the Health Authority Diabetes Team will be in contact with you.";
"Please click on this link to fill out a contact form:" <a href=contactForm.html>contact form</a>
var messageHigh3 = "Your results show that you currently have a HIGH risk of developing diabetes. Your main risk factors are your age and your sugar levels. We advise that you contact the Health Authority to discuss your risk factors as soon as you can. Please fill in our contact form and a member of the Health Authority Diabetes Team will be in contact with you.";
"Please click on this link to fill out a contact form:" <a href=contactForm.html>contact form</a>
var messageHigh4 = "Your results show that you currently have a HIGH risk of developing diabetes. Your main risk factors are your BMI and family history. We advise that you contact the Health Authority to discuss your risk factors as soon as you can. Please fill in our contact form and a member of the Health Authority Diabetes Team will be in contact with you.";
"Please click on this link to fill out a contact form:" <a href=contactForm.html>contact form</a>
var messageHigh5 = "Your results show that you currently have a HIGH risk of developing diabetes. Your main risk factors are your BMI and your sugar levels. We advise that you contact the Health Authority to discuss your risk factors as soon as you can. Please fill in our contact form and a member of the Health Authority Diabetes Team will be in contact with you.";
"Please click on this link to fill out a contact form:" <a href=contactForm.html>contact form</a>
var messageHigh6 = "Your results show that you currently have a HIGH risk of developing diabetes. Your main risk factors are your family history and your sugar levels. We advise that you contact the Health Authority to discuss your risk factors as soon as you can. Please fill in our contact form and a member of the Health Authority Diabetes Team will be in contact with you.";
"Please click on this link to fill out a contact form:" <a href=contactForm.html>contact form</a>
function displayMsg()
{
var age, bmi, family, sugar;
age = document.querySelector('input[name = "age"]:checked').value;
bmi = document.querySelector('input[name = "bmi"]:checked').value;
family = document.querySelector('input[name = "family"]:checked').value;
sugar = document.querySelector('input[name = "sugar"]:checked').value;
var total = age + bmi + family + sugar;
document.getElementById("container").innerHTML = "<b>Your result: </b><br>";
if( total >= 0 && total <= 15)
{
document.getElementById("container").innerHTML += messageLow;
}
else if(total >= 16 && total <= 25)
{
document.getElementById("container").innerHTML += messageMed;
}
elseif (total > 25)
{
if (age=>10 && bmi =>10)
}{
document.getElementById("container").innerHTML += messageHigh1;
}
{
if (age=>10 && family =>10)
}{
document.getElementById("container").innerHTML += messageHigh2;
}
{
if (age=>10 && sugar =>10)
}{
document.getElementById("container").innerHTML += messageHigh3;
}
{
if (bmi=>10 && family =>10)
}{
document.getElementById("container").innerHTML += messageHigh4;
}
{
if (bmi=>10 && sugar =>10)
}{
document.getElementById("container").innerHTML += messageHigh5;
}
{
if (family=>10 && sugar =>10)
}{
document.getElementById("container").innerHTML += messageHigh6;
}
else
{
break;
}
}