<script src=\"modernizr.custom.05819.js\"></script> </head> <body> <header> <h1>
ID: 642765 • Letter: #
Question
<script src="modernizr.custom.05819.js"></script>
</head>
<body>
<header>
<h1>
Hands-on Project 3-1
</h1>
</header>
<article>
<h2>Lunch selections</h2>
<form>
<input type="checkbox" id="item1" value="8" />
<label for="item1">Fried chicken ($8.00)</label>
<input type="checkbox" id="item2" value="10" />
<label for="item2">Fried halibut ($10.00)</label>
<input type="checkbox" id="item3" value="8" />
<label for="item3">Hamburger ($8.00)</label>
<input type="checkbox" id="item4" value="13" />
<label for="item4">Grilled salmon ($13.00)</label>
<input type="checkbox" id="item5" value="6" />
<label for="item5">Side salad ($6.00)</label>
<input type="button" value="Submit" id="sButton" />
</form>
<div>
<p id="total"></p>
</div>
</article>
<script>
// display total
function calcTotal () {
var itemTotal = 0;
var items = document.getElementsByTagName("input");
for (var i = 0; i < 5; i++) {
}
dcoumnet.getElementById("total").innerHTML = "Your order total is $" + itemTotal +".00";
if (items[i].checked) {
itemTotal += (items[i].value *1);
}
}
var submitButton = document.getElementById("sButton");
if (submitButton.addEventListener){submitButton.addEventListener("click", calcTotal, false);
} else if (submitButton.attachEvent){
submitButton.attachEvent("onclick", calcTotal);
}
</script>
</body>
</html>
can anyone tell me why this is not working, it is for my javscript class?
Explanation / Answer
You have mistake in script writing once check it then it will be working
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.