Question: 2) Given the HTML file below, write a script file which A) - Searches for all occurences of a word in each paragraph within the

2) Given the HTML file below, write a script file which A) - Searches for all occurences of a word in each paragraph within the div section using querySelectorAll to place the paragraphs into an array and search each paragraph individually for a word Alias the button click button to the function which performs the searches for the applicable paragraphs. - For each paragraph element in the array of paragraphs, searches for a word which is input on the HTML page via the textbox or a span tab, and if it finds the word, highlight the entire word in yellow using a css styling selector Use the object function indexOf in the statement mainParas[i].textContent.indexOf(searchPhrase) >= 0) where mainParams[i] is the ith paragraph element, and searchPhrase is the textcontent of a textbox, or a spantab. Make use of document.getElementById("id") to extract the data from the textbox. B) Extends the js to count the number of words found and place that result in the textcontent of a heading element. C) Generalizes the application to search for any type of element for the occurrences of the word and then counts the number of occurrences of a word within each of the html types ( inner list, paragraph, outer list)       

The Phoenix Suns are a professional basketball team based in Phoenix, Arizona. They are members of the ...

The Suns have been generally successful since they began play as an expansion team in 1968. In forty years of play they have posted ...

On January 22, 1968, the NBA awarded expansion franchises to an ownership group from Phoenix and one from Milwaukee. ...

  • Richard L. Bloch, investment broker/real estate developer...
  • Karl Eller, outdoor advertising company owner and former...
  • Donald Pitt, Tucson-based attorney;
  • Don Diamond, Tucson-based real estate investor.

Page by New Person.
Some (all) information taken from Wikipedia.


Search for text:

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!