From 5031952ad3a83eb6e225d5107b58f52d502006ad Mon Sep 17 00:00:00 2001 From: Mariani Giacomo <mariang1@t31300-lr138.org.aalto.fi> Date: Wed, 25 Mar 2020 13:08:55 +0200 Subject: [PATCH] updates to exercise --- content.js | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/content.js b/content.js index 9510586..f1f8975 100644 --- a/content.js +++ b/content.js @@ -349,8 +349,40 @@ let Content = { query_selector_all: { instructions: `The text of the pizza toppings is wrong, help us fix it. Find all the <code>li</code> elements within the <code>ul</code> element with - <code>id="pizza-topping"</code> using the <code>document.querySelectorAll()</code> - method. Then fix the <em>innerText</em> of each element.`, + <code>id="pizza-toppings"</code> using the <code>document.querySelectorAll()</code> + method. Then fix the <em>innerText</em> of each element. The grader does not care + if you are using upper case letters or not, so don't worry about that. + Finally print the NodeList to the console. For example:<br/> + <code><br/> + let toppings = document.querySelectorAll(/*your code here*/);<br/> + /*Go through the Nodes in the toppings variable and set the right innerText*/<br/> + /*......*/<br/> + console.log(toppings);<br/> + </code><br/> + If your code is correct, the names in the list below the editor will change. + Testing with the dev tools console on the exercise itself might not give the + expected results and might also break the grading. For this reason we advise + you to copy the following code into an empty HTML file, and test your solution + in there by opening it within with the browser and using the developer tools + console:<br/> + <code><br/> + <!DOCTYPE html><br/> + <html lang="en"><br/> +  <head><br/> +   <meta content="text/html;charset=utf-8" http-equiv="Content-Type"><br/> +   <meta content="utf-8" http-equiv="encoding"><br/> +  </head><br/> +  <body><br/> +   <h3>Pizza toppings:</h3><br/> +   <ul id="pizza-toppings"><br/> +    <li>Batsilica</li><br/> +    <li>Tomtato</li><br/> +    <li>Morezarella</li><br/> +    <li>Hamster</li><br/> +   </ul><br/> +  </body><br/> + </html><br/> + </code> `, initialJs: '', preExecuteJs:` let consolePrint = []; -- GitLab