Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I am looking for help to the solution to this in New Perspectives HTML5, CSS3 - Chapter 12 review. Document Nodes and Style Sheets HTML

I am looking for help to the solution to this in New Perspectives HTML5, CSS3 - Chapter 12 review.

image text in transcribedimage text in transcribed

image text in transcribed

Document Nodes and Style Sheets HTML and CSS HTML 955 Complete the following: 1. Use your editor to and bc_keys_txt.js files from the html12 review ent section of each file, and save them as 2. Go to the bc fed vour editor to open the bc_fed_txt.html and bc keys txt.is files from the Ider. Enter your name and the date in the comment section of each file, and hc fed.html and bc_keys.js respectively. the bc fed.html file in your editor. Directly above the closing tag, the bc_keys.js JavaScript file, loading the file asynchronously. Take some time to contents of the HTML file and then close it, saving your changes. co to the bc_keys.js file in your editor. Add event listeners to run the findKey words and makeKeyStyles() functions when the page is loaded. Caste the findKey Words() function to locate the keywords from the document and se le rindkeyWords() function, perform the tasks described in steps 5 onously. Take some time to study the the keyword list. Within the findKeywor through 10. 5. Create an aside element with the ID "keywords" and containing an hi heading with the text "Keyword List". 6. Create an ol element and append it to the keywords aside element. 7. Next, generate the list of keywords and add IDs to each keyword entry in the source article. Create an object collection named keyWordElems referencing all den elements within the doc article (Hint: Use the querySelectorAll() method.) Create an array named key Words with a length equal to the length of the keyWordElems collection. Add a for loop that loops through all the items in the keyWordElems object collection, and for each item do the following: a. Set the value of each item in the keyWords array to the text of the corresponding item in the keyWordElems object collection. b. Next, set the ID of the current item in the keyWords array. However, the ID cannot contain blank spaces. Norene has supplied you with the replaceWS() function to replace blank spaces with the "_" character. Call the replaceWS() function with the current keyword as the parameter value and store the value returned by the function in the linkID variable. C. Set the ID of current item in the keyWordElems object collection to "keyword_linkID" where linkId is the value of the linkID variable. 8. Sort the key Words array in alphabetical order. 9. Next, generate the list items in the keyword list. Add a for loop that loops through each item in the keyWords array, doing the following for each item: a. Declare the key WordListItem variable, storing an li element. b. Declare the key WordLink variable storing an a element. C. Change the innerHTML of keyWordLink to the value of the text of the current keyword. d. Declare the linkID variable containing the value returned by the replace WS() function using the current keyword as the parameter value. e. Change the href attribute of keyWordLink to "#keyword_linkID" where linkId is the value of the linkID variable. 1. Append key WordLink to keyWordList and then append keyWordList to the ordered list you created in Step 6. 956 HIML dilu LJJ f the article element with 10. Insert the keywords list box you defined in Step 5 as the first child of the ax et for the keywords box, the ID "doc". 11. Next, create the makeKeyStyles() function that will define the style sheet for the Add the following commands to the function: a. Create an embedded style sheet and append it to the document head, b. Add the following style rules to the style sheet: aside#keywords { border: 3px solid rgb(101, 101, 101); float: right; margin: 20px 0px 20px 20px; padding: 10px; width: 320px; aside #keywords hi { font-size: 2em; margin: 5px; text-align: center; aside#keywords ol { margin-left: 20px; font-size: 1.2em; aside #keywords ol li { line-height: 1.5em; aside#keywords ol li a { color: rgb(101, 101, 101); text-decoration: none; 12. Document your code with comments throughout the JavaScript file and then save your change 13. Open the bc_fed.html file in your browser and verify that the page resembles the conten layout shown in Figure 12-53. Verify that you can click the entries in the keyword list corresponding term in the Federalist 10 article. in the keyword list to go to the Find a Contact 69 Address Book ules OneNote Unread/ Categorize Follow bc_keys.js - Notepad File Edit Format View Help New Perspectives on HTML5, CSS3 and Javascript 6th Edition Tutorial 12 Review Assignment Author: Date: Filename: bc_keys.js Functions findKeywords () Locate the keywords in the article indicated by the tag and add those keywords in alphabetical order to a keyword box. makeKeystyles() Create an embedded style sheet for the keyword box. replacews (textstr) Replaces occurences of one or more consecutive white space characters with the character. /* Supplied Functions */ function replacews(textStr) { var revText = textstr.replace(/\S+/g,"_"); return revText; 6/25/2018 9:46 AM 10/23/2019 3:31 PM Microsoft Excel W... Microsoft Excel W... 12 KB 13 KB hing and hats Offline status: Online Date created: 6/7/2018 7:30 PM Offline availability: Not available

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

More Books

Students also viewed these Databases questions