JavaScript Objects Part 2: Search within Content

Objectives

  • The user will type whatever content they want in the textarea for the long content, and also type a single character in the input box provided
  • Submit button will search for the character the user typed inside the content in the textarea and will count how many times this character is shown in the big content
  • If the character is found, you will present a message in the output/result area that says how many times the character shows up in the content
  • If the character is not found, present a new window, using the window.open() method, with an error message

Results






Part 1


Create a script that verifies user entry is a four decimal number and present calculations using Math.round, Math.sort, Math.floor, toFixed(), and parseFloat()

View Part 1

Part 2


Write a sccript that allows the user to enter long text into a textarea, then enter a single character in a separate input. The script will count how many times the single character is in the long text.

View Part 2

Part 3


Create a script that validates user input for a telephone number in (999) 999-9999 format.

View Part 3