Preview

JavaScript

Satisfactory Essays
Open Document
Open Document
504 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
JavaScript
1. Give the syntax of do..while statement. while (condition) { code block to be executed
}
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 in a string within the []. To access an image by number you must firstgive 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"

document.images["image01"]
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)+" ");

var str = "JavaScript"; document.write(str.charAt(str.length -6));

4. Explain how a Date object's instance is created and used. Also describe any three methods of the Date object.
Date objects are created with the new Date() constructor. They are used to work with dates and times such as months, years, or even milliseconds. You can use the Date object without parameters, which makes a new date object with the current date and time. You can also use the Date object with a date string, which makes a new date object with the specified date and time. Or you could use the Date object with a number, which makes a new date object with number of millisecond since 1970/01/01.
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 ('subscribe_frm');
6. Give syntax of calling JavaScript functions from button, checkbox and text objects. function isChecked(form) { var checked =

You May Also Find These Documents Helpful

  • Satisfactory Essays

    Bsbwor501 Final Exam

    • 397 Words
    • 2 Pages

    (TCO 1) If you wanted to insert the current date into an active cell, which of the…

    • 397 Words
    • 2 Pages
    Satisfactory Essays
  • Powerful Essays

    17. Click these options on the Menu bar to display the Date and Time dialog box.…

    • 1234 Words
    • 5 Pages
    Powerful Essays
  • Satisfactory Essays

    it238 r6 appendix c

    • 243 Words
    • 2 Pages

    1. Write JavaScript® code that anticipates and handles an error for an expected numeric field. This code is executed on keypress, and the entered value is saved for you in a variable called enteredChar. Include the try block of JavaScript® statements needed to check if the character is not a number or a nonalphanumeric character, or if you throw an error message.…

    • 243 Words
    • 2 Pages
    Satisfactory Essays
  • Better Essays

    Prg/420 Week 5

    • 958 Words
    • 4 Pages

    This tutorial is designed to provide you with an understanding of the Java Calendar class, it’s backgrounds, purpose and uses. It is created in such a manner as to allow even beginning Java programmers an understanding and feel for the uses of the Java Calendar class. The Java Calendar class was added to the Java Development Kit in JDK 1.1. It is designed to permit the conversion between a specific instance in time and a set of Calendar fields. (Oracle, 2004, 2010) What exactly does this mean? The Calendar class uses a huge array of tables to keep track of time based on daylight savings time, timezones, and calendar history, the calendar class uses a system time to determine where whatever event is being tracked falls on in the internal calendar tables. Some confusion is caused by this as Java does keep track of specific location time, and the programmer needs to keep this in mind when using the Calendar class even when it isn’t relevant to the problem being addressed (Roedy Green, Canadian Mind Products, 1196-2011).…

    • 958 Words
    • 4 Pages
    Better Essays
  • Good Essays

    4) The ________ function isolates a specific portion of a date, such as the day, month, or year, in a date field.…

    • 1829 Words
    • 8 Pages
    Good Essays
  • Powerful Essays

    Due Date: The first day of the semester. No points will be awarded for late work. Be prepared to participate in a class discussion on the first day of school.…

    • 673 Words
    • 3 Pages
    Powerful Essays
  • Satisfactory Essays

    Coding

    • 335 Words
    • 2 Pages

    of any impingements. The camera was then removed from the subacromial space. The area was then infiltrated with Marcaine. The posterior portal was then closed with absorbable sutures and Steri-Strips, and a Mepore dressing was placed on it. The arm was then placed in a sling; the patient awakened and was placed on her hospital bed and taken to the recovery room in good…

    • 335 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    History 110a

    • 509 Words
    • 3 Pages

    a. Dates help us make sense of the past because they allow us to "map" the past, and see the order that things happened.…

    • 509 Words
    • 3 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Assigment 1 Lab Fl via

    • 475 Words
    • 2 Pages

    Question 6: What are the various time units that you can use while developing a model? Where do you provide this information?…

    • 475 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Web Browser

    • 463 Words
    • 2 Pages

    Browser detection – detect which version of browser user is using to adjust viewing settings…

    • 463 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    box marked “input.” In this case, the object is the 4,600 million year geologic time…

    • 386 Words
    • 2 Pages
    Good Essays
  • Good Essays

    Paradox Of Choice

    • 747 Words
    • 3 Pages

    Date Due: To be handed in Thursday, February 19, 2014 at the beginning of class…

    • 747 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    reading

    • 1948 Words
    • 8 Pages

    Tuesday, January 12, 2010 (at beginning of class). Please be prepared to discuss the questions and your responses in class on this date.…

    • 1948 Words
    • 8 Pages
    Satisfactory Essays
  • Good Essays

    After School Programs

    • 704 Words
    • 3 Pages

    6. Date field work was started. January 14, 2013. Date field work completed. April 14, 2013…

    • 704 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    why oky

    • 304 Words
    • 5 Pages

    Which of the following is NOT an advantage of CSS defined for the entire site?…

    • 304 Words
    • 5 Pages
    Satisfactory Essays