HTML/CSS JAVASCRIPT please help me answer this question I will give you a good rating Thank you! Given the following word search application, which searches for words in paragraphs, modify it so that it     Adds two spans tab within the HTML within the designated new "Illustate" text segments as shown below. Has a new click event which searches the occurrence of the word within all span tabs residing                within the first div container , then highlights the text in the span tab which contains the word c) In the same routine, count the number of times ( using a global variable) that the word is found Within the object array loop for span tabs ( where the indexOf statement is located) and after all span tabs are highlighted, send that number to a new html element ( a div, h1, span, p choice is up to you). The count should be continually accumulated and should show the total number of times a word is found in a span tab for all user activated clicks of the search button for all click searches activated by the use          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 Unknown Author. Some (all) information taken from Wikipedia. Search for text: Search                                JAVASCRIPT FILE    dom_2_newp.js function searchClick() { var searchPhrase = document.getElementById("searchtext").value; var main = document.getElementById('main'); var mainParas = main.getElementsByTagName('p'); for (var i = 0; i < mainParas.length; i++) { if (mainParas[i].textContent.indexOf(searchPhrase) >= 0) { mainParas[i].classList.add('highlighted');}    // highlight else { mainParas[i].classList.remove('highlighted');              // un-highlight          }                                                             }                                                   } const document1 = document.querySelector('#searchbutton'); document1.addEventListener('click',searchClick);                            CSS FILE OUTSTYLE.CSS /* A style for paragraphs that have been highlighted from a search. */ .highlighted { background-color: yellow; border: 1px dashed #666600; font-weight: bold; } .parlen{    width:50px;} .highlighted1{ background-color:yellow;}

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

HTML/CSS JAVASCRIPT please help me answer this question I will give you a good rating Thank you!

Given the following word search application, which searches for words in paragraphs, modify it so that it    

  1. Adds two spans tab within the HTML within the designated new "Illustate" text segments as shown below.
  1. Has a new click event which searches the occurrence of the word within all span tabs residing  

             within the first div container , then highlights the text in the span tab which contains the word

c) In the same routine, count the number of times ( using a global variable) that the word is found

Within the object array loop for span tabs ( where the indexOf statement is located) and

after all span tabs are highlighted, send that number to a new html element ( a div, h1, span, p

choice is up to you). The count should be continually accumulated and should show the total

number of times a word is found in a span tab for all user activated clicks of the search button

for all click searches activated by the use

<html>

<head>

<link rel="stylesheet" href="outstyle.css">

    <script src="dom_2_newp.js" defer></script>

    

</head>

<body>

<div id="main">

<p>The Phoenix Suns are a professional basketball team based in

Phoenix, Arizona. They are members of the ...</p>

<p>The Suns have been generally successful since they began play as an

expansion team in 1968. In forty years of play they have posted ...</p>

<p>On January 22, 1968, the NBA awarded expansion franchises to an

ownership group from Phoenix and one from Milwaukee. ...</p>

<ul>

<li>Richard L. Bloch, investment broker/real estate developer...</li>

<li>Karl Eller, outdoor advertising company owner and former...</li>

<li>Donald Pitt, Tucson-based attorney;</li>

<li>Don Diamond, Tucson-based real estate investor.</li>

</ul>

</div>

<p>Page by Unknown Author. <br />

Some (all) information taken from Wikipedia.</p>

<hr />

<div>

Search for text:

<input id="searchtext" type="text" />

<button id="searchbutton">Search</button>

</div>

</body>

</html>

       

                       JAVASCRIPT FILE    dom_2_newp.js

function searchClick() {

var searchPhrase = document.getElementById("searchtext").value;

var main = document.getElementById('main');

var mainParas = main.getElementsByTagName('p');

for (var i = 0; i < mainParas.length; i++) {

if (mainParas[i].textContent.indexOf(searchPhrase) >= 0)

{ mainParas[i].classList.add('highlighted');}    // highlight

else {

mainParas[i].classList.remove('highlighted');              // un-highlight

         }

                                                            }

                

                                 }

const document1 = document.querySelector('#searchbutton');

document1.addEventListener('click',searchClick);

                           CSS FILE OUTSTYLE.CSS

/* A style for paragraphs that have been highlighted from a search. */

.highlighted {

background-color: yellow;

border: 1px dashed #666600;

font-weight: bold;

}

.parlen{

   width:50px;}

.highlighted1{

background-color:yellow;}

The Phoenix Suns are a professional basketball team based in Phoenix, Arizona. Illustrate This 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 Illustrate This Again 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 Unknown Author.
Some (all) information taken from Wikipedia.
Search for text: Illustrate
Search
Transcribed Image Text:The Phoenix Suns are a professional basketball team based in Phoenix, Arizona. Illustrate This 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 Illustrate This Again 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 Unknown Author. Some (all) information taken from Wikipedia. Search for text: Illustrate Search
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 4 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY