Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 2. (10 points) JavaScript DOM Write the JavaScript code to add behavior to a web page for manipulating strings. The page UI allows the

image text in transcribed
Question 2. (10 points) JavaScript DOM Write the JavaScript code to add behavior to a web page for manipulating strings. The page UI allows the user to type a phrase into a text box. The user can click the "Go!" button to display the words in that phrase in reverse order. Each word in the phrase should be inserted as a span with a class of word, inside a div with the id of words. (The word class gives the spans their appearance in the screenshots below giving them a border and a background and so on.) Every other word (the first, third, fifth, etc.) should also be underlined. The user can optionally specify a "filter" text by typing into a text box with the id of filter. Ifa non-blank filter is specified, you should exclude any words from the phrase that contain that filter text, case-insensitively. For example, if the filter text is "abc," exclude any words containing abc, ABC, aBc, etc. If any words are excluded, under the list of words you should modify the div with id of count to display text of the form, "5 word(s) filtered out. The code should work for multiple clicks of the button. On each click it should dear any previous information you injected. You may assume that words in the phrase are separated by single spaces. Do not use any JavaScript libraries such as jQuery or Prototype. Here is the relevant HTML code for the page:

Sentence Reverser!
Phrase: cinput id-"phrase type-cext size-"40 >
Filter:
cbutton id-"go">Go!/button>
These screenshots show the initial state, and after phrases have been typed and "Go!" is clicked. Sentence Reverser Sentence Reverser AREHow helio Sentence Sentence Fila ARE shorethe

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Horse Betting The Road To Absolute Horse Racing 2

Authors: NAKAGAWA,YUKIO

1st Edition

B0CFZN219G, 979-8856410593

More Books

Students also viewed these Databases questions

Question

=+applying to all or most employers and employees?

Answered: 1 week ago

Question

=+associated with political parties and if so, which ones? Are

Answered: 1 week ago