JSFiddle - React, Tailwind, and code Playground

by Ramya Ranganathan

HTML

<p>Your job is to create JavaScript that will ask the user if they have read the book and then apply the <b>highlight</b> style to the book if they have read it.</p>

<ul>
    <li>Oryx and Crake</li>
    <li>East of Eden</li>
    <li>Wizard of the Crow</li>
    <li>Catch-22</li>
</ul>

CSS

.readBook {
    background-color:yellow;
}

JavaScript

// your code below!
"use strict";
window.onload = function () {
console.log("yay");
var yesNo = prompt("Have you read" + " " + "book");
 
 function traverse(el, fn){
            fn(el);
            for (var i = 0; i < el.children.length; i++) {
                traverse(el.children[i], fn);
            }
        }
       	var liList = new Array();
        function ulList(e){
            if (e.tagName.indexOf("l")==0) {
                liList.push(e);
            }
    
}