Question
In this exercise, youll make a couple of quick enhancement to the Miles Per Gallon application, like clearing the two entries if the user double-clicks
In this exercise, youll make a couple of quick enhancement to the Miles Per Gallon application, like clearing the two entries if the user double-clicks in the Miles Per Gallon text box. Estimated time: 10 to 15 minutes.
2. Run the application to see that it works just like the one in the book. Then, in the JavaScript in the HTML file, note that theres a clearEntries() function that isnt used.
3. Enhance the application so the entries are cleared when the user double-clicks in the Miles Per Gallon text box. (Incidentally, this wont work if the text box is disabled.)
4. Enhance the application so the Miles Driven text box is cleared when it receives the focus. Then, do the same for the Gallons of Gas Used text box.
5. Enhance the application so the calculation is done when the focus leaves the Gallons of Gas Used text box. To do the calculation, you just need to run the processEntries() function when that event occurs.
Calculate MPG Calculate Miles Per Gallon
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started