1
2
3
4
5
6
7
8
9
10
To practice on your own, or to check code you believe shouldn't have been scored as incorrect, go to CodePen.
0,1,2,3,4,5,6,7,8,9
0
0
0
0
A field has been assigned to the variable fld. Fill in the blank to assign its value to the variable aVal. | let aVal = ___________; | fld.value | fld\.value |
A field has been assigned to the variable fld. Set its value to 0. | fld.value = 0; | fld\.value=0; | |
The id of a field is "name". Assign the field to the variable nameField. | let nameField = document.querySelector("#name"); | letnameField=document\.querySelector\(•#name•\); | |
The name field has been assigned to the variable nameField. Display the value of the field in an alert. | alert(nameField.value); | alert\(nameField\.value\); | |
The age field has been assigned to the variable ageField. Get the value of the field and assign it to a variable. Make up the name of the variable. | let ageValue = ageField.value; | let[a-z_$][a-zA-Z0-9_$]*=ageField\.value; | |
The city field has been assigned to the variable citF. Set the field's value to "Baku." | citF.value = "Baku"; | citF\.value=•Baku•; | |
A field's name is "address". In a single statement get the value of the field and assign it to a variable. Make up the name of the variable. | let val = document.querySelector("[name = 'address']").value; | let[a-z_$][a-zA-Z0-9_$]*=document\.querySelector\(•\[name=◘address◘\]•\)\.value; | |
The integer 144 has been assigned to the constant gross. In a single statement assign the number (using the constant) to the field whose id is "qty". | document.querySelector("#qty").value = gross; | document\.querySelector\(•#qty•\)\.value=gross; | |
|
|||
|