To Lecture Notes

IT 130 -- 2/17/10

 

Review Questions

  1. 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;

     
  2. 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;
     
  3. 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>
     
  4. 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

 

Structured Programming

 

Using Decision (If Statements)

 

Project Proj6