Why is 0 being assigned to my variables??
My JavaScript numeric variables are being defaulted to 0 (zero) regardless of the value I enter for the HTML input. Whyyyy!?!?!? <!DOCTYPE html> <html> <head> <script languuage = "JavaScript"> ////CALCULATOR//// function calculate() { var cutLen1 = Number(document.getElementById(cutLen1)); console.log(cutLen1); var cutLen2 = Number(document.getElementById(cutLen2)); var cutTimes1 = Number(document.getElementById(cutTimes1)); var cutTimes2 = Number(document.getElementById(cutTimes2)); var stkLen1 = Number(document.getElementById(stkLen1)); var qty1 = Number(document.getElementById(qty1)); var mar1 = String(document.getElementById("mar1")); console.log("mar1"); var mar2 = String(document.getElementById("mar2")); var gp1 = String(document.getElementById("gp1")); var totalCuts = cutLen1 * cutTimes1; var totalStk = stkLen1 * qty1; document.getElementById("result").innerHTML = totalCuts; }///END OF CALCULATE FUNCTION </script> </head> <body> <div id = "cutlist"> <table border="2" align = "left"> <tr> <td>Cut Length</td> <td>Cut times</td> <td>Mark</td> <td>Length</td> <td>QTY</td> <td>Group</td> </tr> <tr> <td><input type="number" id=cutLen1></td> <td><input type="number" id=cutTimes1></td> <td><input type="string" id="mar1"></td> <td><input type="number" id=stklen1></td> <td><input type="number" id=qty1></td> <td><input type="string" id="gp1"></td> </tr> <tr> <td><input type="number" id="cutlen2"></td> <td><input type="number" id="cutTimes2"></td> <td><input type="string" id="mar2"></td> </tr> </table> </div> <div> <button id = "runButton" onclick= "calculate()" value= "result">Run</button> <p id = "result"></p> </div> </body> </html>