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. To concatenate multiple parts into a string
document.getElementById("ButtonId").onclick = functionName;
ondblclick
var stringVar = "part 1:" + "part 2";
string
2. To write a line to the current element of the DOM (Document Object Model)
document.writeln("Text Here") //Advances to new line after text
udddd
document.getElementById("textAreaId").value;
document.getElementById("TextBoxId").disabled = true;
3. To view the current web address using JavaScript
window.location()
document.getElementById("radioButtonId").value;
setMilliseconds()
var functionName = function(param1, param2, paramN) {}
4. To set the current checked status of the control for radio buttons
!==
document.getElementById("radioButtonId").checked = true; //Could also be false
sensitive
var answerVar = confirm("Message Text Here")
5. ________ comments start with / and end with /.
Math.abs(number)
window.location()
===
Multi line
6. To set the digit precision of a decimal number
getFullYear()
document.getElementById("TextBoxId").value;
document.getElementById("textAreaId").value;
toFixed(digitCount)
7. To get the current value for textboxes
document.getElementById("radioButtonId").checked = true; //Could also be false
var functionName = function(param1, param2, paramN) {}
document.getElementById("TextBoxId").value;
for (counter; condition; incrementor) {}
8. To write text to the current element of the DOM
document.write("Text Here") //Remains on current line
document.writeln("Text Here") //Advances to new line after text
toFixed(digitCount)
substring(startIndex, stopIndex)
9. The identity operator for equals
===
toString()
document.getElementById("listId").value;
window.location = "New Web Address Here";
10. To access the text element in a <span> tag
document.getElementById("spanId").firstChild;
document.getElementById("checkboxId").checked;
getFullYear()
substring(startIndex)
11. The available set methods for a Date object: setFullYear() - setMonth() - setDate() - setHours() - setMinutes() - setSeconds() - _________
toFixed(digitCount)
udddd
toTimeString()
setMilliseconds()
12. To assign the value from a prompt to a non-string variable
document.getElementById("TextBoxId").focus;
Number.NEGATIVE_INFINITY
Use the second parameter. Example: prompt("Enter Age:", "18")
Use a parse. Example : var intVar = parseInt(prompt("Text Here"))
13. To set the control to be disabled for textboxes
while (condition) {}
document.getElementById("radioButtonId").checked = true; //Could also be false
document.getElementById("textAreaId").value = "Text Value";
document.getElementById("TextBoxId").disabled = true;
14. String object method used to return a new string that contains part of the original string from the specified start position
Math.pow(number, power)
Charset
substring(startIndex)
document.getElementById("radioButtonId").checked;
15. The string escape sequence to insert a tab in JavaScript
'
document.getElementById("radioButtonId").checked;
t
toLowerCase()
16. To assign the return value of confirm() to a variable
\
var answerVar = confirm("Message Text Here")
standard equality operators
Multi line
17. The syntax of a conditional operator
var arrayVar = new Array()
var variableName;
document.getElementById("checkboxId").checked;
(Condition_Expression) ? Value_If_True : Value_If_False;
18. This returns only True or false values
document.write("Text Here") //Remains on current line
string
Math.round(number)
confirm()
19. Number object method used to return a numerical string with the specified number of significant digits
document.getElementById("textAreaId").value;
Objects
toPrecision(precision)
document.getElementById("TextBoxId").value;
20. Math object method used to return the lowest value for a set of supplied numbers
Math.min(var1, var2, varN)
var dateVar = new Date()
toLowerCase()
Objects
21. The string escape sequence to insert a single quote in JavaScript
22. To assign the value from a prompt to a string
ondblclick
redeclare
Math.pow(number, power)
var stringVar = prompt("Text Here")
23. Number object method used to round numbers to the specified number of decimal places
window.location()
charAt(position)
Math.random() //Returns a value >= 0.0 but <1.0
toFixed(digits)
24. The string escape sequence to insert a form feed in JavaScript
concat(var1, var2, varN)
string
v
f
25. To create a Date object in JavaScript
toPrecision(precision)
toLowerCase()
substring(startIndex, stopIndex)
var dateVar = new Date()
26. String object method used to concatenate multiple strings
var dateObject = new Date("11/22/2012 18:25:35")
document.getElementById("checkboxId").value;
concat(var1, var2, varN)
alert("Alert Text Here")
27. Math object method used to return the absolute value of a given number
document.getElementById("TextBoxId").focus;
toExponential(digits)
Math.abs(number)
n
28. To test that a variable contains a valid number
ondblclick
isNaN(varHere) //Returns true or false.
document.getElementById(id)
document.getElementById("ButtonId").onclick = functionName;
29. Number object method used to return a number in exponential format with the specified number of decimal places
Objects
toExponential(digits)
v
window.onload = function() {//actions here}
30. Math object method used to return a given number that has been rounded to the closes integer value
Math.abs(number)
document.getElementById("radioButtonId").value;
document.writeln("Text Here") //Advances to new line after text
Math.round(number)
31. When you add a string and a number the result will be a ____
Math.round(number)
string
udddd
t
32. Math object method used to return a given number rounded to the next lowest integer value
toExponential(digits)
document.getElementById("checkboxId").checked;
toString()
Math.floor(number)
33. To get the text value of the control for radio buttons
document.getElementById("radioButtonId").value;
Two forward slashes "//"
confirm("Message Text Here")
concat(var1, var2, varN)
34. To denote a string in JavaScript
'
v
Either single or double quotes surrounding the data
document.getElementById("listId").value;
35. String object method used to return a new string that contains part of the original string from the specified start position and up to but not including the specified stop index
document.getElementById("CheckboxId").checked = true; //Could also be false
substring(startIndex, stopIndex)
toLowerCase()
Math.ceil(number)
36. A statement that yields a value
expression
document.getElementById("textAreaId").value = "Text Value";
document.getElementById("listId").value;
document.getElementById(id)
37. When you __________ a javascript variable it retains its original value
v
redeclare
Math.round(number)
Underscores
38. What Date object method is used to return the number of milliseconds since the start of GMT
Math.sqrt(number)
global
getTime()
Math.floor(number)
39. To assign actions to the window onLoad event
var dateObject = new Date("11/22/2012 18:25:35")
document.getElementById("radioButtonId").checked = true; //Could also be false
window.onload = function() {//actions here}
n
40. To code a for statement in JavaScript
charAt(position)
toLowerCase()
isNaN(varHere) //Returns true or false.
for (counter; condition; incrementor) {}
41. Command to display a prompt
prompt("Text Here")
t
n
Charset
42. To access a page element by id
sensitive
document.getElementById("TextBoxId").focus;
document.getElementById(id)
global
43. Number object method used to return a string with a given number base
document.getElementById("ButtonId").onclick = functionName;
t
Number.NEGATIVE_INFINITY
toString(base)
44. The format to create a new Date object from a string
substring(startIndex)
global
var answerVar = confirm("Message Text Here")
var dateObject = new Date("11/22/2012 18:25:35")
45. To make the browser load a new page using JavaScript
var dateVar = new Date()
window.location = "New Web Address Here";
"
expression
46. To alter the value of the text element in a span tag
document.getElementById("spanId").firstChild.nodeValue = "New Value";
Underscores
document.getElementById("TextBoxId").focus;
ondblclick
47. The string escape sequence to insert a vertical tab in JavaScript
v
getFullYear()
f
indexOf(searchValue, startPosition)
48. The string escape sequence to insert a double quote in JavaScript
document.getElementById(id)
charAt(position)
concat(var1, var2, varN)
"
49. The identity operator for not equal
!==
document.getElementById("listId").value;
expression
document.getElementById(id)
50. To get the current checked status of the control for checkboxes
toDateString()
document.getElementById("checkboxId").checked;
Math.pow(number, power)
toFixed(digits)