Skip to content

Commit

Permalink
sync finished html files with examples in guides/javascript/buildingb… (
Browse files Browse the repository at this point in the history
#555)

Two things modified.

First, live output not syncing with code (especiall select tags) in
Active learnings (A simple calendar and More color choices) could be
solved with adding some inintializing.

Second, "More color choices" has mismatched selection value "psych" vs
"psychedelic".
  • Loading branch information
TaebeomHeo authored Aug 26, 2024
1 parent ee704fd commit bbe9283
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions javascript/building-blocks/calendar-finished.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ <h1></h1>
}
}

select.value = 'January';
createCalendar(31, 'January');
</script>
</body>
Expand Down
6 changes: 4 additions & 2 deletions javascript/building-blocks/more-color-choices-finished.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<option value="black">Black</option>
<option value="purple">Purple</option>
<option value="yellow">Yellow</option>
<option value="psych">Psychedelic</option>
<option value="psychedelic">Psychedelic</option>
</select>

<h1>This is my website</h1>
Expand All @@ -37,12 +37,14 @@ <h1>This is my website</h1>
case 'yellow':
update('yellow','darkgray');
break;
case 'psych':
case 'psychedelic':
update('lime','purple');
break;
}
}

select.value = 'white';
update('white','black');
function update(bgColor, textColor) {
html.style.backgroundColor = bgColor;
html.style.color = textColor;
Expand Down

0 comments on commit bbe9283

Please sign in to comment.