Question: In the code below, you will find 5 errors. Clearly identify each error and how you resolve each error. (1 point per error) var $

In the code below, you will find 5 errors. Clearly identify each error and how you resolve each error. (1 point per error) var $ function (id) 8 9 10 returndocument.getElementById(id); var calculateMpgfunction() 12 13 14 15 16 17 18 19 20 21 console.log("calculateMpg function has started"); var miles = parseFloat($("miles'').value); var gallonsparseFloat($("gallons").value); console.log("miles" miles); console.log("gallons "+ gallons); if (isNaN (miles) isNAN (gallons)) f Alert( "Both entries must be numeric."); else 23 24 25 26 27 28 29 console.log("The data is valid and the calculation is var mpg miles / gallons; console.log ("mpg "+ mpg); $ ("mpg").value mpg.toFixed(1); window.onloadfunction) calculatempg; 31 32 $ ("calculate").onclick s ("miles") .focus ()
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
