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. What Date object method is used to return the number of milliseconds since the start of GMT
document.getElementById("TextBoxId").disabled = true;
getTime()
confirm()
Number.NEGATIVE_INFINITY
2. Date object method used to return a string containing the date
document.getElementById("radioButtonId").value;
var arrayVar = new Array()
toDateString()
Either single or double quotes surrounding the data
3. The string escape sequence to insert a form feed in JavaScript
redeclare
Underscores
f
alert("Alert Text Here")
4. To set the current checked status of the control for radio buttons
document.getElementById("radioButtonId").checked = true; //Could also be false
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
var stringVar = "part 1:" + "part 2";
Multi line
5. A _______ variable can be changed and accessed from within and without a function or object.
Charset
global
t
document.getElementById("radioButtonId").checked = true; //Could also be false
6. Math object method used to return a given number raised to a given power
Math.abs(number)
toFixed(digitCount)
Math.pow(number, power)
event handler .
7. To get the current value of the control for a text area
window.location = "New Web Address Here";
Multi line
document.getElementById("textAreaId").value;
var dateObject = new Date("11/22/2012 18:25:35")
8. The string escape sequence to insert a backslash in JavaScript
Multi line
Underscores
n
\
9. The identity operator for equals
document.getElementById("radioButtonId").checked = true; //Could also be false
document.getElementById("TextBoxId").value;
concat(var1, var2, varN)
===
10. To declare a variable in JavaScript
semicolon ";"
var variableName;
var dateVar = new Date()
r
11. To get the current value for textboxes
Math.floor(number)
window.location()
document.getElementById(id)
document.getElementById("TextBoxId").value;
12. To code a for statement in JavaScript
getFullYear()
substring(startIndex)
var stringVar = "part 1:" + "part 2";
for (counter; condition; incrementor) {}
13. To alter the value of the text element in a span tag
document.getElementById("spanId").firstChild.nodeValue = "New Value";
var variableName;
toString()
ondblclick
14. Date object method used to return a string containing the date and time
toString()
var functionName = function(param1, param2, paramN) {}
toString(base)
Two forward slashes "//"
15. To assign actions to the window onLoad event
<noscript>
window.onload = function() {//actions here}
r
document.getElementById(id)
16. The string escape sequence to insert a tab in JavaScript
n
t
Math.round(number)
toTimeString()
17. Math object method used to return the absolute value of a given number
window.onload = function() {//actions here}
\
getTime()
Math.abs(number)
18. A list-like construct that has properties which corresponds to JavaScript values or variables or other objects.
substring(startIndex, stopIndex)
Number.NEGATIVE_INFINITY
Objects
Math.min(var1, var2, varN)
19. The string escape sequence to insert a vertical tab in JavaScript
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
v
var dateObject = new Date("11/22/2012 18:25:35")
document.getElementById("TextBoxId").value;
20. To denote a string in JavaScript
Math.pow(number, power)
Either single or double quotes surrounding the data
document.getElementById("spanId").firstChild;
Math.abs(number)
21. This returns only True or false values
document.getElementById("TextBoxId").value;
confirm()
event handler .
toDateString()
22. String object method used to concatenate multiple strings
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
charAt(position)
Math.floor(number)
concat(var1, var2, varN)
23. To get the text value of the control for radio buttons
concat(var1, var2, varN)
document.getElementById("radioButtonId").value;
var functionName = function(param1, param2, paramN) {}
focus
24. The valid characters for an identifier in JavaScript: Letters - Numbers - ________ and Dollar Signs
Math.sqrt(number)
Underscores
substring(startIndex, stopIndex)
document.getElementById(id)
25. To write a line to the current element of the DOM (Document Object Model)
document.getElementById("textAreaId").value;
!==
Charset
document.writeln("Text Here") //Advances to new line after text
26. String object method used to return the position of the first instance of a specified search string starting from the specified index
f
indexOf(searchValue, startPosition)
Math.pow(number, power)
v
27. To create a new Date object
window.location()
focus
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
document.getElementById("TextBoxId").value;
28. To get the current checked status of the control for radio buttons
Number.NEGATIVE_INFINITY
toTimeString()
Math.min(var1, var2, varN)
document.getElementById("radioButtonId").checked;
29. To insert Javascript into a web page
toLowerCase()
var stringVar = prompt("Text Here")
document.getElementById("TextBoxId").value;
<script type="text/javascript">.....</script>
30. What String object method returns a new string containing the value of the original string but in all lower case
var stringVar = "part 1:" + "part 2";
concat(var1, var2, varN)
document.getElementById("checkboxId").checked;
toLowerCase()
31. To get the value or the currently selected item for lists
!==
document.getElementById("radioButtonId").checked;
document.getElementById("radioButtonId").checked = true; //Could also be false
document.getElementById("listId").value;
32. To assign the return value of confirm() to a variable
indexOf(searchValue, startPosition)
confirm()
var variableName;
var answerVar = confirm("Message Text Here")
33. To code a button.onclick event handler
document.getElementById("radioButtonId").value;
getTime()
document.getElementById("ButtonId").onclick = functionName;
\
34. To view the current web address using JavaScript
document.getElementById("textAreaId").value;
r
document.getElementById("spanId").firstChild.nodeValue = "New Value";
window.location()
35. The string escape sequence to insert a carriage return in JavaScript
<script type="text/javascript">.....</script>
f
while (condition) {}
r
36. The identity operator for not equal
Math.max(var1, var2, varN)
!==
v
document.write("Text Here") //Remains on current line
37. The available get methods for a Date object: getTime() - _________ - getMonth() - getDate() - getHours() - getMinutes() - getSeconds() - getMilliseconds()
t
string
getFullYear()
window.onload = function() {//actions here}
38. To create a single line comment in JavaScript
expression
Two forward slashes "//"
var arrayVar = new Array()
document.getElementById("radioButtonId").checked;
39. To display an alert
alert("Alert Text Here")
while (condition) {}
Src - e.g. <script src="fileName.js"> //
Math.round(number)
40. Math object method used to return a given number rounded to the next lowest integer value
toPrecision(precision)
Math.floor(number)
var arrayVar = new Array()
Two forward slashes "//"
41. The string escape sequence to start a new line in JavaScript
document.write("Text Here") //Remains on current line
n
Objects
toFixed(digits)
42. When you add a string and a number the result will be a ____
string
redeclare
toString(base)
Math.min(var1, var2, varN)
43. To code an If statement in JavaScript
if (condition) {}
f
!==
document.getElementById("ButtonId").onclick = functionName;
44. To assign a default value to a prompt
Use the second parameter. Example: prompt("Enter Age:", "18")
'
toUpperCase()
document.writeln("Text Here") //Advances to new line after text
45. The syntax of a conditional operator
document.getElementById("radioButtonId").checked;
event handler .
var variableName;
(Condition_Expression) ? Value_If_True : Value_If_False;
46. To get the current checked status of the control for checkboxes
document.getElementById("checkboxId").checked;
confirm("Message Text Here")
var functionName = function(param1, param2, paramN) {}
===
47. The ________ tag is used to display the text between the opening and closing tag if JavaScript is disabled or otherwise not available
confirm()
<noscript>
Math.min(var1, var2, varN)
redeclare
48. To create a function that returns a value in JavaScript
Two forward slashes "//"
toExponential(digits)
var functionName = function(param1, param2, paramN) {}
Multi line
49. Math object method used to return a given number that has been rounded to the closes integer value
document.getElementById("textAreaId").value;
Math.round(number)
document.getElementById("listId").value;
substring(startIndex, stopIndex)
50. To set focus on the control for textboxes
Math.ceil(number)
\
prompt("Text Here")
document.getElementById("TextBoxId").focus;