Javascript Write function displayWords to do the following Empty parameter list Initialize variable wordStr equal to HTM
Posted: Fri Jul 01, 2022 5:43 am
Javascript
Write function displayWords to do the following
Empty parameter list
Initialize variable wordStr equal to HTML element <hr />
Loop through the array words
Append to variable wordStr the current element in array words concatenated with HTML element <br />
d.) Update the value of HTML element id "js-words-found" to variable wordStr
HTML:
<!DOCTYPE html><head> <link rel="stylesheet" type="text./css" media="screen" href="boggle.css" /> <script type="text/javascript" src="jquery-2.1.0.js"></script> <script src="boggle.js" ></script></head><body> <div class="container"> <div class="grid-9"> <div id="js-boggle" class="boggle"></div>
<input type="text" id="js-word" class="enter-word" /> <input type="button" id="js-enter-word" class="btn" value=" Enter " oneclick="addWord();"/> </div> <div class="grid-3"> <div> Words Found </div> <div class="words-found" id="js-words-found"></div> </div> </div></body>
Write function displayWords to do the following
Empty parameter list
Initialize variable wordStr equal to HTML element <hr />
Loop through the array words
Append to variable wordStr the current element in array words concatenated with HTML element <br />
d.) Update the value of HTML element id "js-words-found" to variable wordStr
HTML:
<!DOCTYPE html><head> <link rel="stylesheet" type="text./css" media="screen" href="boggle.css" /> <script type="text/javascript" src="jquery-2.1.0.js"></script> <script src="boggle.js" ></script></head><body> <div class="container"> <div class="grid-9"> <div id="js-boggle" class="boggle"></div>
<input type="text" id="js-word" class="enter-word" /> <input type="button" id="js-enter-word" class="btn" value=" Enter " oneclick="addWord();"/> </div> <div class="grid-3"> <div> Words Found </div> <div class="words-found" id="js-words-found"></div> </div> </div></body>