To Lecture Notes
IT 130 -- 2/17/10
Review Questions
- Write a JavaScript statement that causes the image control
with id=imgDog to display boxer.jpg.
Ans:
Using name: document.images.imgDog.src = boxer.jpg;
Using id: document.getElementById(imgDog.src) = boxer.jpg;
- Write a JavaScript statement that assigns the value of the
variable n to the textbox with id=txtInput.
Ans:
Using name: document.frmA.txtInput.value = n;
Using id: document.getElementById(txtInput).value = n;
- Write HTML code for a dropdown menu ddmCities that displays the three
city names Atlanta, Chicago, and Philadelphia.
Ans:
<select name=ddmCities>
<option>Atlanta</option>
<option>Chicago</option>
<option>Philadelphia</option>
</select>
- Write a JavaScript statement that copies the selected item from
ddmCities into the textbox txtCity.
Ans document.frmA.txtCity.value = document.frmA.ddmCities.value;
Page with Navigation
- A page with side navigation bar that uses layers (div tags) for
positioning:
- The modern method of laying out pages is to use a CSS stylesheet to
position layers specified by div tags.
- Here is the CSS style page:
greece-styles.css.
Structured Programming
Using Decision (If Statements)
- Look at the source code of these examples:
Project Proj6