Week 12 - Debug Quiz - Part 2
BackThis quiz is about debugging whats wrong with our code. That's an important thing to learn.
Question 5
Find 5 errors in the HTML below
<form _action="https://example.com/form.php">
<h1>
Fill in this form
</h1>
<input type="name" name="name">
<input type="text" name="address">
<input type="number" name="age">
<input type="phone" name="phone">
<div>
<label>Favorite color:</label>
<input type="radio" name="color" value="red"> Red
<input type="radio" name="color_green" value="green"> Green
</div>
<div>
<label>Favorite animal</label>
<input type="checkbox" name="animal"> Tiger
<input type="checkbox" name="animal"> Cow
</div>
<input type="submitt">
</form>
Question 6
Find 5 errors in the CSS below
body {
color: #e23h5d;
background-color: #eee;
font-size: 20px
}
section {
border: 1px dotted #ccc;
border-radius: 8;
color: #f44eca5;
margin-top: 16px;
pading-bottom: 16px;
}
Question 7
We're writing a program that lists the content of an array. But something doesn't work!
Find 5 errors in the JavaScript code below
let items = ['banana', 'pear', 'pinapple'];
let html = '<ul>';
for (let i = 1; i <= items.length; i++) {
html += '<li id="item-"' + i + '>' + items[i] '</li>';
}
html = '<ul>';
document.body.innerHTML = html;
Question 8
The code below will throw an error in the console. Whats wrong here?
let html = '<div id="box">Gold & Diamonds</div>';
$box = document.getElementById('box');
let treasure = $box.innerHTML;
document.body.innerHTML = html;
console.log('My treasure: ' + treasure);