Write a javascript functions in an external file


Discuss the following:

1 Produce an HTML form with a textarea, 5 text boxes and a button.

2 Invite the user to type 10 or more characters in the textarea and then click the button.

3 Validate the textarea by ensuring that it is not left blank. As an additional (optional) task, you may wish to generate a separate error message if there is some input but it includes no vowels.

4 Write one or more JavaScript functions in an external .js file that will read through the input and count the number of letters which are vowels: a,e,i,o,u. Keep five separate counts, one for each of the vowels. Hint: the value of a single character in a string can be saved like this: singleCharacter = stringName.charAt(i); where i indicates the position of the character in the string.

5 Display the five vowel totals in the five input boxes.

6 Place the five vowel totals in an array and search through the array to see which letter appears most frequently in the input (Hint: think about using a variable called something like 'biggestSoFar'). Change the background colour of the input box displaying the total of the most frequently occurring vowel to yellow or gold. To provide some evidence that you have gone beyond the requirements, you may wish (as an optional task) to also find the second and third most frequently occurring vowels in the input. Change the background colour of their input boxes to silver and brown or bronze.

Use HTML5 comments, JavaScript comments and CSS comments in the respective files to explain the code you have used. Unexplained code will be interpreted as possible evidence of plagiarism.

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Write a javascript functions in an external file
Reference No:- TGS01938142

Now Priced at $20 (50% Discount)

Recommended (90%)

Rated (4.3/5)