So the user enters in the weight of apples that they want. Then the total is calculated using a standard formula and then it is printed out. I cant seem to get the output to work. Thanks in advance for the help.
<!DOCTYPE html>
<html>
<head>
<script type= "text/javascript">
function output(){
var total=0,nb1=0,nb2=0,nb3=0;
nb1=document.orderForm.apple.value;
nb2=document.orderForm.orange.value;
nb3=document.orderForm.banana.value;
total=(nb1*0.65)+(nb2*0.50)+(nb3*0.73);
document.writeln("The total price for all your fruit is "+ total);
}
</script>
</head>
<body>
<form>
<label>
Apples:
<input type ="text" name="apple" size="3" >
<br>
<br>
Orange:
<input type ="text" name="orange" size="3">
<br>
<br>
Banana:
<input type ="text" name="banana" size="3">
<br>
<br>
<button
type="button" onClick="orderFrom()" value = "Submit" > Submit
</button>
<input type="reset">
</label>
</form>
</body>
</html>
nb1=document.orderForm.apple.value;- this will no work