Question: 1. If the variable hours = 10, what is the value of the variable salary after the following instruction has been executed: salary = hours
1. If the variable hours = 10, what is the value of the variable salary after the following instruction has been executed: salary = hours * 8
| a. | 10 |
| b. | 8 |
| c. | 80 |
| d. | cannot tell from the information given |
2. Which tags are used to provide alternate content for users who have disabled scripts in their browsers?
| a. |
|
| b. | |
| c. | < /no script> |
| d. | there are no such tags |
3. Which would be used to have a JavaScript function named hello() execute before the user views a web page?
| a. |
|
| b. | |
| c. |
|
| d. | |
4. Which of the following describes a JavaScript object?
| a. | anything you can click on |
| b. | anything that describes something you can click on |
| c. | anything something you can click on can do |
| d. | any HTML tag pair |
5. Which of the following describes a JavaScript method?
| a. | anything you can click on |
| b. | anything that describes something you can click on |
| c. | anything something you can click on can do |
| d. | any HTML tag pair |
6. Which of the following describes a JavaScript property?
| a. | anything you can click on |
| b. | anything that describes something you can click on |
| c. | anything something you can click on can do |
| d. | any HTML tag pair |
7. Which method allows you to display text on an HTML page?
| a. | onload |
| b. | show() |
| c. | display() |
| d. | write() |
8. Which method will retrieve the contents of an HTML element?
| a. | document.get() |
| b. | getElementById() |
| c. | innerHTML |
| d. | document.innerHTML |
9. Which would you use to replace the contents of an HTML page with the value stored in a variable named student?
| a. | document.write(student); |
| b. | document.getElementById(student); |
| c. | document.write(student.innerHTML); |
| d. | document.write(student.HTML); |
10. Which of the following will open a new window named mywindow that is 600 pixels in height and 350 pixels wide?
| a. | mywindow = new window(height = 600, width = 350); |
| b. | mywindow = window.open(height = 600, width = 350); |
| c. | mywindow = window.open(""; ""; height = "600"; width = "350"); |
| d. | mywindow = window.open("", "", "height = 600, width = 350"); |
11. Which of the following will close a window named mywindow ?
| a. | close mywindow; |
| b. | mywindow = close(); |
| c. | mywindow.close(); |
| d. | mywindow.close; |
12. Which of the following will prompt the user to enter his or her name?
| a. | var name = window.open("What is your name?"); |
| b. | prompt("What is your name?", name); |
| c. | var name = document.write("What is your name?"); |
| d. | var name = prompt("What is your name?"); |
13. Which is the correct way to define a function named getAge()?
| a. | function getAge() { body of function } |
| b. | getAge = new function |
| c. | getAge() { body of function } |
| d. | new function getAge() { body of function } |
14. Which of the following would retrieve the value displayed in a element which has id = "football" and store that information in a variable named sport?
| a. | sport = document.getElementById("football"); |
| b. | document.getElementById("football") = sport; |
| c. | sport = document.innerHTML(id = "football"); |
| d. | document.write("football"); |
1. True/False: A program variable is the name of a storage location in the computer's internal memory.
2. True/False: Numeric variables in JavaScript can be either integers or floating point numbers.
3. True/False: JavaScript is a strongly typed language.
4. True/False: When a user enters a number at a prompt, it is stored initially as text.
5. True/False: The following statement would be considered true in JavaScript: "JACK" > "jack".
6. True/False: The conditional operator uses two symbols and takes three operands.
7. True/False: The charAt() function will tell you what a specific character is in a given string.
8. True/False: The correct way to identify the first character in a string variable named word is:
var letter = charAt(word);
9. True/False: You may use either single or double quotes to enclose the value of the text in a string variable.
10. True/False: Logical operators must always be done in order from left to right.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
