Question: head > - const COST _ PER _ LB = 5 0 ; const COST _ PER _ MILE = 7 5 ; const
head
const COSTPERLB ;
const COSTPERMILE ;
const SETUPCOST ;
Global Variables
let wgtBox document.getElementByIdwgtBox;
let distBox document.getElementByIddistBox;
let msgBox document.getElementByIdmsgBox;
Event Handlers
document.getElementByIdwgtBoxonchange calcTotal;
document.getElementByIddistBoxonchange calcTotal;
document.getElementByIdsetupBoxonclick calcTotal;
Function to calculate an estimate of the total moving cost
Gfunction calcTotal
let totalCost ; Set the initial estimate to $
msgBox.innerHTML ; Erase any warnings in the message box
totalCost wgtBox.value COSTPERLB;
totalCost distBox.value COSTPERMILE;
if documentgetElementByIdsetupBoxchecked
totalCost SETUPCOST
Display the moving cost estimate in the totalBox, formatted as currency
document.getElementByIdtotalBoxinnerHTML formatCurrencytotalCost;
Function to display a numeric value as a text string in the format $####
function formatCurrencyvalue
return value.toFixed ;
Filename: styles.css
apply a natural box layout model to all elements
Z
mozboxsizing: borderbox;
webkitboxsizing: borderbox;
boxsizing: borderbox;
reset rules
html body, div, span, applet, object, iframe,
h h h h h h p blockquote, pre,
a abbr, acronym, address, big, cite, code,
del, dfn em img, ins, kbd q s samp,
small, strike, strong, sub, sup, tt var,
b u i center,
dl dt dd ol ul li
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr th td
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time mark, audio, video
margin: ;
padding: ;
border: ;
fontsize: ;
font: inherit;
verticalalign: baseline;
HTML displayrole reset for older browsers
article, aside, details, figcaption, figure,
ffooter, header, hgroup, menu, nav, section
display: block;
Gbody
lineheight: ;
width: px;
background: white;
margin: auto;
fontfamily: Verdana, Geneva, sansserif;
Gol, ul
liststyle: none;
page header
Jheader
background: #B;
width: ;
color: #FFFFFF;
fontsize: px;
textalign: center;
lineheight: em;
main content
Jarticle
width: px;
height: px;
textalign: left;
background: #FFDB;
position: relative;
Garticle h
fontweight: bold;
fontsize: px;
padding: px;
form
paddingleft: px;
Glabel
display: inlineblock;
width: px;
float: left;
clear: left;
marginbottom: px;
Ginput
float: left;
marainbottom: px:
Gdiv#totalBox
width: px;
float: left;
outline: px solid gray;
height: px;
lineheight: px;
fontsize: px;
textalign: right;
backgroundcolor: white;
paddingright: px;
span
display: inlineblock;
float: left;
marginleft: px;
lspan#msgBox
color: red;
fontsize: ;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
