Download this page and open with Dreamweaver. Or right click and select "View Source", then cut and paste the code to Dreamweaver.
Use the place indicated in the code for this JavaScript exercise.
Construct an array containing the months of the year as strings. Using a for loop itterate over this printing each month to the page. Surround each month with a pair of HTML <p> tags, so what you are printing into the page is, for example: <p>January</p>.
You will need to use concatenation and dynamic page techniques for this in addition to the loop.
Construct 2 arrays, one containing the teams from last year's premiership season and another one containing the points that they scored last season. Make sure these are in the order they finished the season from first to twentieth.
Write a for loop which itterates over these arrays and creates a HTML table containing the final premiership football standings from last season. This table must contain three columns labled "Position", "Team" and "Points".
A suggested approach would be to:
Using the modulus operator (as shown below) to determine if each row is odd or even. Add a CSS class attribute to each <tr> tag with either "odd" or "even" as a value depending on whether the modulus operator returns 1 or 0. Use an if / else block inside the for loop to acomplish this.
Next add a <style> block to the head of this page and code two CSS classes, one for tr.odd and one for tr.even, use these to add differing background colours to the odd and even rows.
var modulus = rowNum % 2;