JavaScript正在添加数字7和11并获得711,而不是像它应该的那样18。必须是动态的,这就是我使用getElementByID的原因。在此示例中,Hardcopy = 7 ElectronicCopy = 11.以下是示例代码。
var TotalSites = document.getElementById("TotalSites").innerHTML;
var HardCopy = document.getElementById("ImagingMaterialsHardCopy").innerHTML;
var ElectronicCopy = document.getElementById("ImagingMaterialsElectronic").innerHTML;
var LTR = HardCopy + ElectronicCopy;
var LefttoRec = LTR - TotalSites;