Question
Within the kg_search.js file have a function run when the page is loaded that inserts the contents of the word search table and word search
Within the kg_search.js file have a function run when the page is loaded that inserts the contents of the word search table and word search list into the web page, and sets up the event handlers and event listeners for the document.
Declare whatever global variables you feel are needed to complete the assignment.
Write the code that will satisfy Petes condition for the word search app. Your code should contain at least one example of the following:
- An application of an event handler
- An application of an event listener
- Removing an event listener from a page element
- Application of a CSS inline style to a page element
- An alert dialog box
- A command that prevents a default browser action in response to an event
=========================================================================
kg_search.js
"use strict";
/*
New Perspectives on HTML5, CSS3 and JavaScript 6th Edition
Tutorial 11
Case Problem 4
Wordsearch Game Script
Filename: kg_search.js
Author:
Date:
Function List
function drawWordSearch(letters, words)
Returns the HTML code for a word search table based on the entries
in the letters array and the location of the words
in the words array
showList(list)
Returns the HTML for code for an unordered list of words based
on the items in the list array
*/
/*============================================================*/
function drawWordSearch(letters, words) {
var rowSize = letters.length;
var colSize = letters[0].length;
var htmlCode = "
"; } else { htmlCode += " | "; } htmlCode += letters[i][j]; htmlCode += " | ";
return htmlCode;
}
function showList(list) {
var htmlCode = "
- ";
- " + list[i] + " ";
for (var i = 0; i < list.length; i++) {
htmlCode += "
}
htmlCode += "
return htmlCode;
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started