CSC 370: The Week beginning Jan. 25 |
Make a page that includes a table displaying information on a subject of your choosing (possibilities include movies, tv shows, books, sports, stocks, cars). The table should have several columns and several rows. The table should also allow the user to interact, for example, a page with movies would allow a user to rate movies, e.g. using drop-dwon lists or radio buttons). You should have at least one hyperlink and one image. Your page should be styled and have at least twenty distinct element attribute-value pairs in your style section. At least one of these should style the hyperlink. Post your page to the alpha or some other server and send me the link. The page should validate for HTML ansd CSS.
<input id="btnDisplayColor" type="button" value="Display Color" onclick="return DisplayColor();" />
function DisplayColor() {
var hexcode;
hexcode = "#" + document.getElementById("selRed").value;
hexcode += document.getElementById("selGreen").value;
hexcode += document.getElementById("selBlue").value;
document.getElementById("display").style.backgroundColor = hexcode;
document.getElementById("hexcode").innerHTML = hexcode;
}
The arguments "selRed", "selGreen", "selBlue, "display" and "hexcode" are
all id attribute values of elements on the page. Note how the id attribute
plays an important role in JavaScript and allows one to specify and access an element.
It can be used to determine the properties and/or state of the element or to change
the properties and/or state of the element.