WDV2221 Intro Javascript

Unit-5 Assignment - External JavaScript Functions with Parameters

Directions:

Problem 1

a. Create a global variable called totalSales. Assign it a value of 4375.6. It should be numeric data type.

b. Attach the currencyFormatFunctions.js as an external JavaScript file and use one of the currency formatting functions to display totalSales formatted as currency in the following line. Call the functions as part of the runtime.

Your Total Sales:

Problem 2

a. Attach the dateFunctions.js as an external JavaScript file. Use the provided date functions and concatenation to display today's date in the following format Monday, January 2, 2018. Call the function as part of the runtime.

Today's date:

Problem 3

a. Attach the dateFunctions.js as an external JavaScript file. Use the provided date functions and concatenation to display today's date in the following format  2, January 2018.

b. Call the function using a button and the onclick event handler.

Today's date:

 

Problem 4

a. Attach the stringMask.js as an external JavaScript file.

b. Write a function to get the value out of the textToMask text box, use the provided maskValue function to display the masked results back in the same text box.