- What is DOM?
- Why do we need it?
- What is the major difference between
document.getElementsByClassName("some-class")
anddocument.getElementById("some-id")
in terms of what it returns? - Answer the following questions using this HTML
<body>
<div>
<ul>
<li class="item">a</li>
<li class="item">b</li>
<li class="item">c</li>
<li class="item">d</li>
<li class="item">e</li>
</ul>
</div>
</body>
- How do we target all the
<li>
? - How do we target even
<li>
s? (b,d) - How do we give each
<li>
an attribute call "my-value" that contain the innerHTML as it's value? - Add a button with an event listener when clicked to each
<li>
to console.log it's attribute "my-value's" value. - How do we change google's "I'm Feeling Lucky" to "I am Feeling Awesome" with javascript? (test it in the chrome developers tool console!)
- What's the difference between
==
and===
in javascript? Please provide an example in which they return different values? - Imagine we need to store all students and grades for the morning assessment in javascript. What would be a good data structure to store this information? Please justify your answer