Deck 10: Loops, Additional Controls, Manipulating Css With Javascript

ملء الشاشة (f)
exit full mode
سؤال
The following code retrieves the radio button collection for a group of radio buttons where "ethnicity" is the name of the radio button group:
EthnicityRBs = form.elements["ethnicity"];
How can you retrieve the selected radio button's value?

A) ethnicityRBs.selection
B) ethnicityRBs.value
C) ethnicityRBs.getValue(0)
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
Suppose birthYears is the name of a pull-down menu control. What happens when the following code executes?
BirthYears.selectedIndex = 0;

A) The pull-down menu expands to show all the menu's options.
B) The pull-down menu displays "invalid."
C) The browser engine selects the pull-down menu's first option.
سؤال
In executing a while loop, the JavaScript engine first executes the while loop's body and then checks the while loop's condition.
سؤال
To create a group of checkboxes, you should use the same id attribute value for each checkbox in the group.
سؤال
You should have a prologue in your JavaScript external files. What is a prologue?
سؤال
There are two techniques for connecting a label element to its control: (1) using a for attribute, and (2) embedding the control inside the label element's start and end tags. What is the difference in functionality between these two techniques?
سؤال
What is the purpose of the z-index CSS property?
سؤال
When executed, what does the following code fragment display?
var x = 5;
var y = x++;
alert("x = " + ++x + ", y = " + y);
سؤال
Is the readonly keyword an HTML attribute or a JavaScript property?
سؤال
To implement a pull-down menu, you provide a select container with a list of elements inside it. Those elements form the selections for the menu. What is the element type for those elements?
سؤال
Which of the following is a list of JavaScript data types?

A) 22, "honey badger", true
B) number, string, object, Boolean
C) <code>num, name, employee, userTurn</code>
سؤال
Proper coding conventions suggest using <code>let</code> instead of <code>var</code> for the for loop's index variable because:

A) the <code>let</code> keyword automatically initializes the index variable to 0.
B) the <code>let</code> keyword limits the scope of the index variable to the <code>for</code> loop.
C) the <code>var</code> keyword is not part of the HTML5 standard (although many browsers still support it).
سؤال
For the textarea control, how do you specify the textarea control's default user input?

A) The browser displays the content between the <code>textarea</code> element's start and end tags.
B) The browser uses the <code>textarea</code> tag's value attribute and displays its value.
C) The browser uses the <code>textarea</code> tag's default attribute and displays its value.
سؤال
If a pull-down menu's <code>select</code> element has a <code>required</code> attribute, it means that when the pull-down menu's form is submitted:

A) the pull-down menu expands to show all the menu's options.
B) the browser highlights the pull-down menu, usually with a red border.
C) the pull-down menu control is considered to be invalid if the user's selected value is the empty string.
سؤال
The number of times that a loop repeats is referred to as the number of loop iterations.
سؤال
Applying the <code>display: flex</code> property-value pair to a container causes the container to expand beyond the browser window's borders.
سؤال
The textarea control's <code>maxlength</code> attribute specifies the maximum number of characters the user can enter into the textarea's box.
سؤال
In a pull-down menu, if no <code>option</code> element has a <code>selected</code> attribute, then the pull-down menu displays "invalid" by default.
سؤال
The length of time that a variable's value survives before it is wiped out is known as a variable's __________.
سؤال
For the textarea control, the ______ attribute specifies the textarea control's height, which is the number of lines of text in the box that can be viewed simultaneously.
سؤال
What happens if you include a multiple attribute with a select element, but do not include a size attribute?

A) The browser displays a pull-down menu with multiple copies of the specified option element.
B) The browser displays a pull-down menu where multiple options can be selected by expanding the pull-down menu multiple times.
C) The browser displays a list box with a default size of 4 (four selections appear simultaneously within the list box).
سؤال
What is an advantage of a list box as compared to a pull-down menu?

A) List boxes can be configured so they allow users to select more than one option.
B) List boxes take up less space.
C) With list boxes, each option has a button at its left.
سؤال
To process a user's selections from a list box, use the select element object's selectedOptions property to access the selected options and loop through those selected options.
سؤال
Local variables persist only for as long as the JavaScript engine is executing code within the variable's function.
سؤال
To make a border around a group of controls, surround the control elements with a legend container. To make a caption for the group, include a fieldset element within the legend container.
سؤال
Every web page element object has a style property, and that style property is an object that has properties for the web page element object's CSS properties.
سؤال
If you include the __________ attribute with a select element, the user will be able to select multiple options.
سؤال
If a pull-down menu's option element has a(n) __________ attribute, the option's value is preselected within the pull-down menu.
سؤال
Suppose you have a collection of checkboxes named skills. To access an individual checkbox within the collection, you can use skills[i]. The i is referred to as a(n) ______ variable.
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/29
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 10: Loops, Additional Controls, Manipulating Css With Javascript
1
The following code retrieves the radio button collection for a group of radio buttons where "ethnicity" is the name of the radio button group:
EthnicityRBs = form.elements["ethnicity"];
How can you retrieve the selected radio button's value?

A) ethnicityRBs.selection
B) ethnicityRBs.value
C) ethnicityRBs.getValue(0)
B
2
Suppose birthYears is the name of a pull-down menu control. What happens when the following code executes?
BirthYears.selectedIndex = 0;

A) The pull-down menu expands to show all the menu's options.
B) The pull-down menu displays "invalid."
C) The browser engine selects the pull-down menu's first option.
C
3
In executing a while loop, the JavaScript engine first executes the while loop's body and then checks the while loop's condition.
False
4
To create a group of checkboxes, you should use the same id attribute value for each checkbox in the group.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
5
You should have a prologue in your JavaScript external files. What is a prologue?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
6
There are two techniques for connecting a label element to its control: (1) using a for attribute, and (2) embedding the control inside the label element's start and end tags. What is the difference in functionality between these two techniques?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
7
What is the purpose of the z-index CSS property?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
8
When executed, what does the following code fragment display?
var x = 5;
var y = x++;
alert("x = " + ++x + ", y = " + y);
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
9
Is the readonly keyword an HTML attribute or a JavaScript property?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
10
To implement a pull-down menu, you provide a select container with a list of elements inside it. Those elements form the selections for the menu. What is the element type for those elements?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
11
Which of the following is a list of JavaScript data types?

A) 22, "honey badger", true
B) number, string, object, Boolean
C) <code>num, name, employee, userTurn</code>
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
12
Proper coding conventions suggest using <code>let</code> instead of <code>var</code> for the for loop's index variable because:

A) the <code>let</code> keyword automatically initializes the index variable to 0.
B) the <code>let</code> keyword limits the scope of the index variable to the <code>for</code> loop.
C) the <code>var</code> keyword is not part of the HTML5 standard (although many browsers still support it).
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
13
For the textarea control, how do you specify the textarea control's default user input?

A) The browser displays the content between the <code>textarea</code> element's start and end tags.
B) The browser uses the <code>textarea</code> tag's value attribute and displays its value.
C) The browser uses the <code>textarea</code> tag's default attribute and displays its value.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
14
If a pull-down menu's <code>select</code> element has a <code>required</code> attribute, it means that when the pull-down menu's form is submitted:

A) the pull-down menu expands to show all the menu's options.
B) the browser highlights the pull-down menu, usually with a red border.
C) the pull-down menu control is considered to be invalid if the user's selected value is the empty string.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
15
The number of times that a loop repeats is referred to as the number of loop iterations.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
16
Applying the <code>display: flex</code> property-value pair to a container causes the container to expand beyond the browser window's borders.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
17
The textarea control's <code>maxlength</code> attribute specifies the maximum number of characters the user can enter into the textarea's box.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
18
In a pull-down menu, if no <code>option</code> element has a <code>selected</code> attribute, then the pull-down menu displays "invalid" by default.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
19
The length of time that a variable's value survives before it is wiped out is known as a variable's __________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
20
For the textarea control, the ______ attribute specifies the textarea control's height, which is the number of lines of text in the box that can be viewed simultaneously.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
21
What happens if you include a multiple attribute with a select element, but do not include a size attribute?

A) The browser displays a pull-down menu with multiple copies of the specified option element.
B) The browser displays a pull-down menu where multiple options can be selected by expanding the pull-down menu multiple times.
C) The browser displays a list box with a default size of 4 (four selections appear simultaneously within the list box).
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
22
What is an advantage of a list box as compared to a pull-down menu?

A) List boxes can be configured so they allow users to select more than one option.
B) List boxes take up less space.
C) With list boxes, each option has a button at its left.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
23
To process a user's selections from a list box, use the select element object's selectedOptions property to access the selected options and loop through those selected options.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
24
Local variables persist only for as long as the JavaScript engine is executing code within the variable's function.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
25
To make a border around a group of controls, surround the control elements with a legend container. To make a caption for the group, include a fieldset element within the legend container.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
26
Every web page element object has a style property, and that style property is an object that has properties for the web page element object's CSS properties.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
27
If you include the __________ attribute with a select element, the user will be able to select multiple options.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
28
If a pull-down menu's option element has a(n) __________ attribute, the option's value is preselected within the pull-down menu.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
29
Suppose you have a collection of checkboxes named skills. To access an individual checkbox within the collection, you can use skills[i]. The i is referred to as a(n) ______ variable.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.