SUBJECTS
|
BROWSE
|
CAREER CENTER
|
POPULAR
|
JOIN
|
LOGIN
Business Skills
|
Soft Skills
|
Basic Literacy
|
Certifications
About
|
Help
|
Privacy
|
Terms
|
Email
Search
Test your basic knowledge |
Javascript Basics
Start Test
Study First
Subject
:
it-skills
Instructions:
Answer 50 questions in 15 minutes.
If you are not ready to take this test, you can
study here
.
Match each statement with the correct term.
Don't refresh. All questions and answers are randomly picked and ordered every time you load a test.
This is a study tool. The 3 wrong answers for each question are randomly chosen from answers to other questions. So, you might find at times the answers obvious, but you will see it re-enforces your understanding as you take the test each time.
1. The events common to most controls: onfocus - onblur - onclick - _______ - onchange - onselect
ondblclick
var arrayVar = new Array()
Math.sqrt(number)
window.location()
2. To assign actions to the window onLoad event
document.getElementById("spanId").firstChild;
window.onload = function() {//actions here}
confirm("Message Text Here")
toDateString()
3. To make the browser load a new page using JavaScript
Number.NEGATIVE_INFINITY
Objects
window.location = "New Web Address Here";
expression
4. Math object method used to return the absolute value of a given number
Math.floor(number)
Math.abs(number)
!==
Math.ceil(number)
5. Date object method used to return a string containing the date and time
getFullYear()
document.getElementById("TextBoxId").value;
toString()
v
6. The valid characters for an identifier in JavaScript: Letters - Numbers - ________ and Dollar Signs
Underscores
udddd
v
for (counter; condition; incrementor) {}
7. A list-like construct that has properties which corresponds to JavaScript values or variables or other objects.
concat(var1, var2, varN)
Objects
Number.NEGATIVE_INFINITY
if (condition) {}
8. Math object method used to return the lowest value for a set of supplied numbers
global
toFixed(digitCount)
Math.min(var1, var2, varN)
toString()
9. To code a button.onclick event handler
document.getElementById("CheckboxId").checked = true; //Could also be false
document.getElementById("checkboxId").value;
<script type="text/javascript">.....</script>
document.getElementById("ButtonId").onclick = functionName;
10. The string escape sequence to insert a single quote in JavaScript
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
11. To get the current checked status of the control for checkboxes
Charset
toLowerCase()
document.getElementById("checkboxId").checked;
document.write("Text Here") //Remains on current line
12. The four attributes of the <script> tag:Type - Src - _____ and Defer
getTime()
var stringVar = "part 1:" + "part 2";
Math.max(var1, var2, varN)
Charset
13. A statement that yields a value
toPrecision(precision)
document.getElementById("checkboxId").checked;
expression
event handler .
14. To denote a string in JavaScript
Either single or double quotes surrounding the data
Math.floor(number)
Math.min(var1, var2, varN)
var variableName;
15. To set focus on the control for textboxes
Math.min(var1, var2, varN)
document.getElementById("TextBoxId").disabled = true;
document.getElementById("TextBoxId").focus;
document.getElementById("TextBoxId").value;
16. Unlike ________________ identity operators do not perform type coercion.
Math.max(var1, var2, varN)
t
standard equality operators
Src - e.g. <script src="fileName.js"> //
17. To write a line to the current element of the DOM (Document Object Model)
document.getElementById("ButtonId").onclick = functionName;
getTime()
t
document.writeln("Text Here") //Advances to new line after text
18. JavaScript is case _______
standard equality operators
Underscores
Either single or double quotes surrounding the data
sensitive
19. The identity operator for not equal
===
udddd
Src - e.g. <script src="fileName.js"> //
!==
20. To create a new Date object
Objects
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
var stringVar = prompt("Text Here")
document.getElementById("textAreaId").value;
21. To declare a variable in JavaScript
window.onload = function() {//actions here}
Math.min(var1, var2, varN)
var variableName;
confirm()
22. The syntax of a conditional operator
toExponential(digits)
(Condition_Expression) ? Value_If_True : Value_If_False;
Src - e.g. <script src="fileName.js"> //
document.write("Text Here") //Remains on current line
23. Math object method used to return the square root of a given number
'
document.getElementById("TextBoxId").focus;
"
Math.sqrt(number)
24. To get the current value for textboxes
concat(var1, var2, varN)
Objects
Math.pow(number, power)
document.getElementById("TextBoxId").value;
25. The string escape sequence to insert a double quote in JavaScript
Two forward slashes "//"
Use the second parameter. Example: prompt("Enter Age:", "18")
"
Use a parse. Example : var intVar = parseInt(prompt("Text Here"))
26. String object method used to return the position of the first instance of a specified search string starting from the specified index
"
focus
indexOf(searchValue, startPosition)
document.getElementById("textAreaId").value;
27. To test that a variable contains a valid number
isNaN(varHere) //Returns true or false.
document.getElementById("textAreaId").value;
Multi line
setMilliseconds()
28. The escape sequence used to insert a Unicode character into a string in JavaScript
udddd
(Condition_Expression) ? Value_If_True : Value_If_False;
Number.NEGATIVE_INFINITY
'
29. To get the text value of the control for radio buttons
sensitive
standard equality operators
f
document.getElementById("checkboxId").value;
30. To access a page element by id
"
ondblclick
document.getElementById(id)
Math.round(number)
31. To get the current value of the control for a text area
r
document.getElementById("spanId").firstChild.nodeValue = "New Value";
Math.sqrt(number)
document.getElementById("textAreaId").value;
32. Number object method used to return a numerical string with the specified number of significant digits
window.onload = function() {//actions here}
var dateObject = new Date("11/22/2012 18:25:35")
Underscores
toPrecision(precision)
33. To get the text value of the control for radio buttons
var variableName;
document.getElementById("spanId").firstChild;
document.getElementById("radioButtonId").value;
toLowerCase()
34. A function that is called with a certain event occurs - e.g. button.onclick and window.onload.
toLowerCase()
event handler .
document.getElementById("TextBoxId").focus;
document.getElementById("spanId").firstChild.nodeValue = "New Value";
35. The available get methods for a Date object: getTime() - _________ - getMonth() - getDate() - getHours() - getMinutes() - getSeconds() - getMilliseconds()
getFullYear()
Use a parse. Example : var intVar = parseInt(prompt("Text Here"))
Math.round(number)
!==
36. To set the current checked status of the control for checkboxes
window.location = "New Web Address Here";
document.writeln("Text Here") //Advances to new line after text
document.getElementById("CheckboxId").checked = true; //Could also be false
expression
37. To code a while statement in JavaScript
getFullYear()
\
while (condition) {}
string
38. The string escape sequence to insert a form feed in JavaScript
f
ondblclick
Either single or double quotes surrounding the data
setMilliseconds()
39. The two methods common to most controls: ______ //Brings focus to the control blur //Removes focus from the control
document.getElementById("TextBoxId").value;
(Condition_Expression) ? Value_If_True : Value_If_False;
Use a parse. Example : var intVar = parseInt(prompt("Text Here"))
focus
40. ________ comments start with / and end with /.
confirm()
document.getElementById(id)
v
Multi line
41. To assign the value from a prompt to a string
!==
var stringVar = prompt("Text Here")
document.write("Text Here") //Remains on current line
Number.NEGATIVE_INFINITY
42. To write text to the current element of the DOM
document.getElementById("TextBoxId").value;
toFixed(digits)
document.write("Text Here") //Remains on current line
Math.abs(number)
43. To insert Javascript into a web page
for (counter; condition; incrementor) {}
<script type="text/javascript">.....</script>
toString()
toDateString()
44. When you add a string and a number the result will be a ____
<script type="text/javascript">.....</script>
string
Charset
document.write("Text Here") //Remains on current line
45. To assign a default value to a prompt
document.getElementById("TextBoxId").value;
r
Use the second parameter. Example: prompt("Enter Age:", "18")
var answerVar = confirm("Message Text Here")
46. The string escape sequence to insert a carriage return in JavaScript
string
toString(base)
f
r
47. To access the text element in a <span> tag
string
document.getElementById("spanId").firstChild;
toString()
!==
48. To get the current checked status of the control for radio buttons
document.write("Text Here") //Remains on current line
charAt(position)
document.getElementById("radioButtonId").checked;
concat(var1, var2, varN)
49. Statements end in JavaScript with a ________
for (counter; condition; incrementor) {}
semicolon ";"
Math.round(number)
Underscores
50. Date object method used to return a string containing the time
toString()
document.getElementById("textAreaId").value;
var stringVar = prompt("Text Here")
toTimeString()