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 set the current checked status of the control for checkboxes
!==
var variableName;
document.getElementById("CheckboxId").checked = true; //Could also be false
if (condition) {}
2. To access the text element in a <span> tag
document.getElementById("spanId").firstChild;
Number.NEGATIVE_INFINITY
focus
setMilliseconds()
3. Statements end in JavaScript with a ________
Charset
document.getElementById("radioButtonId").checked;
semicolon ";"
var arrayVar = new Array()
4. Number object method used to return a string with a given number base
ondblclick
document.getElementById("checkboxId").value;
toFixed(digits)
toString(base)
5. The string escape sequence to insert a vertical tab in JavaScript
<noscript>
t
v
document.write("Text Here") //Remains on current line
6. To assign actions to the window onLoad event
window.location()
window.onload = function() {//actions here}
Use a parse. Example : var intVar = parseInt(prompt("Text Here"))
expression
7. Math object method used to return a given number rounded to the next lowest integer value
toFixed(digits)
Math.floor(number)
window.onload = function() {//actions here}
toString()
8. The ________ tag is used to display the text between the opening and closing tag if JavaScript is disabled or otherwise not available
Underscores
var arrayVar = new Array()
var functionName = function(param1, param2, paramN) {}
<noscript>
9. The escape sequence used to insert a Unicode character into a string in JavaScript
concat(var1, var2, varN)
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
Number.NEGATIVE_INFINITY
udddd
10. The available properties for the Number object: Number.MAX_VALUE - Number.MIN_VALUE - Number.POSITIVE_INFINITY - _______ - Number.NaN
Two forward slashes "//"
redeclare
toLowerCase()
Number.NEGATIVE_INFINITY
11. The string escape sequence to insert a tab in JavaScript
Number.NEGATIVE_INFINITY
n
t
document.writeln("Text Here") //Advances to new line after text
12. To get the current value for textboxes
confirm("Message Text Here")
document.getElementById("TextBoxId").value;
window.location = "New Web Address Here";
confirm()
13. The syntax of a conditional operator
confirm("Message Text Here")
document.write("Text Here") //Remains on current line
while (condition) {}
(Condition_Expression) ? Value_If_True : Value_If_False;
14. Math object method used to return a given number raised to a given power
document.getElementById("spanId").firstChild;
while (condition) {}
for (counter; condition; incrementor) {}
Math.pow(number, power)
15. To create a function in JavaScript
document.writeln("Text Here") //Advances to new line after text
confirm("Message Text Here")
document.getElementById("TextBoxId").disabled = true;
var functionName = function(param1, param2, paramN) {}
16. The available set methods for a Date object: setFullYear() - setMonth() - setDate() - setHours() - setMinutes() - setSeconds() - _________
concat(var1, var2, varN)
setMilliseconds()
n
var stringVar = "part 1:" + "part 2";
17. To set focus on the control for textboxes
document.getElementById("TextBoxId").focus;
Objects
semicolon ";"
standard equality operators
18. To make the browser load a new page using JavaScript
window.location = "New Web Address Here";
Two forward slashes "//"
window.onload = function() {//actions here}
Math.random() //Returns a value >= 0.0 but <1.0
19. When you __________ a javascript variable it retains its original value
redeclare
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
document.getElementById("CheckboxId").checked = true; //Could also be false
setMilliseconds()
20. A function that is called with a certain event occurs - e.g. button.onclick and window.onload.
event handler .
Either single or double quotes surrounding the data
toString(base)
document.getElementById("spanId").firstChild;
21. To declare a variable in JavaScript
window.location = "New Web Address Here";
toUpperCase()
concat(var1, var2, varN)
var variableName;
22. The four attributes of the <script> tag:Type - Src - _____ and Defer
Charset
var dateObject = new Date("11/22/2012 18:25:35")
document.getElementById(id)
substring(startIndex, stopIndex)
23. To denote a string in JavaScript
document.getElementById("TextBoxId").focus;
Either single or double quotes surrounding the data
toFixed(digits)
string
24. To code an If statement in JavaScript
if (condition) {}
Charset
event handler .
document.getElementById("radioButtonId").value;
25. To alter the value of the text element in a span tag
document.getElementById("spanId").firstChild.nodeValue = "New Value";
'
global
Either single or double quotes surrounding the data
26. A _______ variable can be changed and accessed from within and without a function or object.
Number.NEGATIVE_INFINITY
global
Underscores
<noscript>
27. To set the current value of the control for a text area
document.getElementById(id)
Src - e.g. <script src="fileName.js"> //
document.getElementById("textAreaId").value = "Text Value";
document.getElementById("TextBoxId").value;
28. Number object method used to return a numerical string with the specified number of significant digits
document.getElementById("listId").value;
substring(startIndex, stopIndex)
toPrecision(precision)
document.writeln("Text Here") //Advances to new line after text
29. Math object method used to return a random number
getFullYear()
toString(base)
document.getElementById("ButtonId").onclick = functionName;
Math.random() //Returns a value >= 0.0 but <1.0
30. To write a line to the current element of the DOM (Document Object Model)
toPrecision(precision)
string
document.writeln("Text Here") //Advances to new line after text
Math.sqrt(number)
31. The identity operator for equals
===
document.getElementById("TextBoxId").disabled = true;
udddd
<noscript>
32. Date object method used to return a string containing the date and time
n
Either single or double quotes surrounding the data
Objects
toString()
33. To assign the value from a prompt to a non-string variable
Math.sqrt(number)
document.getElementById("spanId").firstChild;
Use a parse. Example : var intVar = parseInt(prompt("Text Here"))
document.getElementById("textAreaId").value = "Text Value";
34. To get the current checked status of the control for checkboxes
t
Number.NEGATIVE_INFINITY
while (condition) {}
document.getElementById("checkboxId").checked;
35. Math object method used to return the lowest value for a set of supplied numbers
Math.min(var1, var2, varN)
!==
var arrayVar = new Array()
"
36. To concatenate multiple parts into a string
Math.min(var1, var2, varN)
toLowerCase()
document.getElementById("checkboxId").checked;
var stringVar = "part 1:" + "part 2";
37. Math object method used to return the absolute value of a given number
document.getElementById("ButtonId").onclick = functionName;
Math.min(var1, var2, varN)
var dateVar = new Date()
Math.abs(number)
38. The string escape sequence to start a new line in JavaScript
prompt("Text Here")
Two forward slashes "//"
document.getElementById("CheckboxId").checked = true; //Could also be false
n
39. To get the value or the currently selected item for lists
isNaN(varHere) //Returns true or false.
document.getElementById("textAreaId").value;
confirm("Message Text Here")
document.getElementById("listId").value;
40. To code a for statement in JavaScript
Number.NEGATIVE_INFINITY
toUpperCase()
expression
for (counter; condition; incrementor) {}
41. To create a single line comment in JavaScript
document.getElementById(id)
var functionName = function(param1, param2, paramN) {}
===
Two forward slashes "//"
42. What Date object method is used to return the number of milliseconds since the start of GMT
toTimeString()
getTime()
toDateString()
document.getElementById("TextBoxId").value;
43. What String object method returns a new string containing the value of the original string but in all lower case
toLowerCase()
window.location = "New Web Address Here";
ondblclick
document.getElementById("checkboxId").value;
44. To insert Javascript into a web page
<script type="text/javascript">.....</script>
Math.sqrt(number)
toTimeString()
toPrecision(precision)
45. To write text to the current element of the DOM
document.write("Text Here") //Remains on current line
document.getElementById("radioButtonId").value;
Number.NEGATIVE_INFINITY
Objects
46. The two methods common to most controls: ______ //Brings focus to the control blur //Removes focus from the control
var dateObject = new Date("11/22/2012 18:25:35")
if (condition) {}
focus
Math.max(var1, var2, varN)
47. The available get methods for a Date object: getTime() - _________ - getMonth() - getDate() - getHours() - getMinutes() - getSeconds() - getMilliseconds()
getFullYear()
Src - e.g. <script src="fileName.js"> //
indexOf(searchValue, startPosition)
toUpperCase()
48. To display a confirmation
var answerVar = confirm("Message Text Here")
confirm("Message Text Here")
r
confirm()
49. To set the control to be disabled for textboxes
focus
t
document.getElementById("TextBoxId").disabled = true;
toUpperCase()
50. The format to create a new Date object from a string
<script type="text/javascript">.....</script>
var dateObject = new Date("11/22/2012 18:25:35")
Two forward slashes "//"
document.getElementById("textAreaId").value = "Text Value";