JSFiddle - React, Tailwind, and code Playground
HTML
<input type="checkbox" name="Books" value="100" onchange ="TotalCost()"> Books $100 per Semester.<br />
<input type="checkbox" name="Tution" value="1000" onchange="TotalCost()">Tution $1000 per semester.<br />
<input type="checkbox" name="Room" value="750" onchange="TotalCost()"> Room and Board $750 per Semester. <br />
<input type="text" id="semestrAttended"/>
JavaScript
document.getElementById("semestrAttended").onchange = function() {
var sa = this.value,
books = document.getElementsByName("Books")[0],
tution = document.getElementsByName("Tution")[0],
roomAndBoard = document.getElementsByName("Room")[0];
books = (books.checked) ? parseInt(books.value) : 0;
tution = (tution.checked) ? parseInt(tution.value) : 0;
roomAndBoard = (roomAndBoard.checked) ? parseInt(roomAndBoard.value) : 0;
sa *= books+tution+roomAndBoard;
alert(sa);
};