I am being instructed to create an element node for the link element and set its rel attribute to "styleSheet", its id attribute to "fancySheet", and its href attribute to "na_style_num.css" (where num is the value of the styleNum variable).
It then wants me to append the fancySheet style element to the document head.
I feel as if I'm really close or really far off here. Here's what I've attempted without luck:
na_styler.js:
window.addEventListener("load", setStyles);
function setStyles() {
var styleNum = randInt(5);
var styleNum = document.createElement("link");
styleNum.setAttribute("rel", "stylesheet");
styleNum.setAttribute("id", "fancySheet");
styleNum.setAttribute("href", "na_style_" + styleNum + .css);
document.head.appendChild(styleNum);
}
I've been receiving a few errors but the problem is it's written in a form I can't really understand. For example:
" Traceback (most recent call last):
File "nt-test-3ed2ebdf.py", line 14, in assert(link.get_attribute('id') == 'fancySheet'), 'The id attribute should be set to "fancySheet". Actual: "' + str(link.get_attribute('id')) + '"'
AssertionError: The id attribute should be set to "fancySheet". Actual: "" "
.cssin this linestyleNum.setAttribute("href", "na_style_" + styleNum + .css);