Premium Essay

Webd241 Week 8 Assignment

In: Computers and Technology

Submitted By jacob27
Words 600
Pages 3
1. Give the syntax of do..while statement.

do { text += "The number is " + i; i++;
}
while (i < 10);

2. Explain how an image could be accessed by name and by array number. You can access an image by name by simply putting the name between quotes. To access an image by number you must first give each image a number in the image array. The images should be numbered in the order that they appear in the source code.

var document.images=new Array (3) document.images[0]="ImageOne.png" document.images[1]="ImageTwo.png"

3. Write a function that uses substring method of String object to get the 'Scr' part of the string 'JavaScript'. Also use the length property and write the length of the string 'JavaScript' and use the charAt method to get the 'S' from 'JavaScript' and write that. var str="JavaScript"; document.write(str.substring(4,7)+" ");

4. Explain how a Date object's instance is created and used. Also describe any three methods of the Date object.
Data objects are used by the destination application either the client or the server. A data object in the destination application is one end of a connection between the source application and the destination application. A data object in the destination application is used to access and interact with the data in the data source. There are two common situations where a data object is needed. The first situation is when data is dropped in your application using drag and drop. The second situation is when Paste or Paste Special is chosen from the Edit menu. getFullYear( ) return the four digit year getMonth( ) return the month getDate( ) return the day of the month

5. Write a function to output the names and values of a form's fields using the elements property of the form.

Name: Email: var frm_element = document.getElement ById...

Similar Documents