Pinegrow Challenge — Color the Boxes
- Take any tool you like – including coding by hand
- Do it in a proper HTML way
- With Pinegrow we do that in 1 minute
Hmmm…
This was less than a minute to write:
<script type="text/javascript">
function colorBoxes() {
var e = document.getElementsByClassName("box");
for (var i = 0, l = e.length; i < l; i++) {
e[i].style["background-color"] = e[i].innerHTML;
}
}
window.addEventListener('load', colorBoxes);
</script>
Does it count? Do I win something?
It would take longer than a minute - to write the creation, appending of styles via JS to a sheet.
Do we need to add a “Challenges” forum section? Might be fun.