Here is the code that I am struggling with, I am trying to create the entire thing in javascript so that I can become more comfortable with the language, I am already fairly strong in html/css. When I run the following code on a localhost nothing is displayed, does anyone have any suggestions as to what I am doing wrong here? I am simply trying to draw a table, insert a tr, and then cells which contain the days of the week that are stored in my variable.
document.body.onload(drawcalendar);
var drawcalendar = function () {
var daysofweek = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
var table = document.createElement("table");
var row = document.table.appendChild("tr");
for (i = 0; i <= daysofweek.length; i++) {
document.table.row.insertCell(daysofweek[i]);
}
}