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 create a Date object in JavaScript
toString()
document.getElementById("checkboxId").value;
var dateVar = new Date()
document.getElementById("TextBoxId").focus;
2. The available properties for the Number object: Number.MAX_VALUE - Number.MIN_VALUE - Number.POSITIVE_INFINITY - _______ - Number.NaN
Number.NEGATIVE_INFINITY
Math.sqrt(number)
isNaN(varHere) //Returns true or false.
standard equality operators
3. To create a function that returns a value in JavaScript
var functionName = function(param1, param2, paramN) {}
toTimeString()
substring(startIndex, stopIndex)
Underscores
4. Math object method used to return the absolute value of a given number
Src - e.g. <script src="fileName.js"> //
for (counter; condition; incrementor) {}
document.getElementById("radioButtonId").checked;
Math.abs(number)
5. The string escape sequence to insert a single quote in JavaScript
6. To alter the value of the text element in a span tag
sensitive
document.getElementById("spanId").firstChild.nodeValue = "New Value";
\
Math.min(var1, var2, varN)
7. Math object method used to return a random number
r
prompt("Text Here")
Math.random() //Returns a value >= 0.0 but <1.0
var dateObject = new Date("11/22/2012 18:25:35")
8. To display an alert
document.getElementById("textAreaId").value = "Text Value";
Two forward slashes "//"
toTimeString()
alert("Alert Text Here")
9. To insert Javascript into a web page
<script type="text/javascript">.....</script>
toDateString()
document.getElementById("textAreaId").value;
if (condition) {}
10. The identity operator for not equal
document.getElementById("TextBoxId").disabled = true;
Underscores
!==
Math.min(var1, var2, varN)
11. To access the text element in a <span> tag
Math.pow(number, power)
var variableName;
global
document.getElementById("spanId").firstChild;
12. Math object method used to return a given number raised to a given power
window.location()
getFullYear()
toUpperCase()
Math.pow(number, power)
13. To set focus on the control for textboxes
document.getElementById("TextBoxId").focus;
Math.min(var1, var2, varN)
for (counter; condition; incrementor) {}
document.getElementById("radioButtonId").checked = true; //Could also be false
14. The string escape sequence to insert a double quote in JavaScript
"
document.getElementById("spanId").firstChild.nodeValue = "New Value";
for (counter; condition; incrementor) {}
document.writeln("Text Here") //Advances to new line after text
15. The ________ tag is used to display the text between the opening and closing tag if JavaScript is disabled or otherwise not available
substring(startIndex, stopIndex)
<noscript>
toUpperCase()
document.getElementById("radioButtonId").checked;
16. The identity operator for equals
Math.pow(number, power)
expression
===
document.getElementById("TextBoxId").disabled = true;
17. To declare a variable in JavaScript
getFullYear()
document.getElementById("textAreaId").value;
alert("Alert Text Here")
var variableName;
18. To assign actions to the window onLoad event
document.getElementById("ButtonId").onclick = functionName;
window.onload = function() {//actions here}
Math.round(number)
Math.pow(number, power)
19. To set the current value of the control for a text area
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
prompt("Text Here")
Math.sqrt(number)
document.getElementById("textAreaId").value = "Text Value";
20. The available get methods for a Date object: getTime() - _________ - getMonth() - getDate() - getHours() - getMinutes() - getSeconds() - getMilliseconds()
toString()
getFullYear()
Math.round(number)
n
21. To code a button.onclick event handler
document.getElementById("ButtonId").onclick = functionName;
toDateString()
while (condition) {}
Use a parse. Example : var intVar = parseInt(prompt("Text Here"))
22. The string escape sequence to insert a vertical tab in JavaScript
toFixed(digitCount)
document.getElementById("TextBoxId").focus;
document.getElementById("radioButtonId").checked;
v
23. When you add a string and a number the result will be a ____
concat(var1, var2, varN)
string
getFullYear()
toDateString()
24. Command to display a prompt
sensitive
prompt("Text Here")
toLowerCase()
Math.pow(number, power)
25. To denote a string in JavaScript
isNaN(varHere) //Returns true or false.
Underscores
document.getElementById("CheckboxId").checked = true; //Could also be false
Either single or double quotes surrounding the data
26. To make the browser load a new page using JavaScript
window.onload = function() {//actions here}
isNaN(varHere) //Returns true or false.
concat(var1, var2, varN)
window.location = "New Web Address Here";
27. What String object method returns a new string containing the value of the original string but in all lower case
toLowerCase()
Math.round(number)
setMilliseconds()
var stringVar = prompt("Text Here")
28. To view the current web address using JavaScript
v
sensitive
window.location()
document.getElementById("spanId").firstChild;
29. To code an If statement in JavaScript
for (counter; condition; incrementor) {}
indexOf(searchValue, startPosition)
if (condition) {}
prompt("Text Here")
30. The escape sequence used to insert a Unicode character into a string in JavaScript
Multi line
if (condition) {}
Math.sqrt(number)
udddd
31. The available set methods for a Date object: setFullYear() - setMonth() - setDate() - setHours() - setMinutes() - setSeconds() - _________
document.getElementById("checkboxId").checked;
Src - e.g. <script src="fileName.js"> //
setMilliseconds()
n
32. The string escape sequence to insert a form feed in JavaScript
"
for (counter; condition; incrementor) {}
Math.abs(number)
f
33. Math object method used to return the lowest value for a set of supplied numbers
confirm("Message Text Here")
document.getElementById("listId").value;
Math.min(var1, var2, varN)
ondblclick
34. To get the current checked status of the control for radio buttons
string
Two forward slashes "//"
document.getElementById("radioButtonId").checked;
window.location()
35. To display a confirmation
toLowerCase()
confirm("Message Text Here")
document.getElementById("spanId").firstChild;
Two forward slashes "//"
36. The two methods common to most controls: ______ //Brings focus to the control blur //Removes focus from the control
toDateString()
Math.pow(number, power)
focus
window.location()
37. Math object method used to return a given number rounded to the next lowest integer value
global
Math.floor(number)
document.getElementById("textAreaId").value;
prompt("Text Here")
38. To get the text value of the control for radio buttons
r
document.getElementById("checkboxId").value;
n
toString()
39. The _____ attribute is used to denote external file for script use
Number.NEGATIVE_INFINITY
Math.ceil(number)
Src - e.g. <script src="fileName.js"> //
Two forward slashes "//"
40. The events common to most controls: onfocus - onblur - onclick - _______ - onchange - onselect
document.getElementById("radioButtonId").checked = true; //Could also be false
toFixed(digitCount)
ondblclick
getFullYear()
41. To get the text value of the control for radio buttons
document.getElementById("radioButtonId").value;
var functionName = function(param1, param2, paramN) {}
getFullYear()
prompt("Text Here")
42. Date object method used to return a string containing the date
toDateString()
getTime()
(Condition_Expression) ? Value_If_True : Value_If_False;
document.getElementById("spanId").firstChild.nodeValue = "New Value";
43. To access a page element by id
toLowerCase()
document.getElementById(id)
document.getElementById("spanId").firstChild.nodeValue = "New Value";
var functionName = function(param1, param2, paramN) {}
44. Date object method used to return a string containing the time
concat(var1, var2, varN)
Use a parse. Example : var intVar = parseInt(prompt("Text Here"))
toString()
toTimeString()
45. The string escape sequence to insert a carriage return in JavaScript
Math.max(var1, var2, varN)
Math.pow(number, power)
var dateObject = new Date("11/22/2012 18:25:35")
r
46. To set the control to be disabled for textboxes
getTime()
Math.random() //Returns a value >= 0.0 but <1.0
redeclare
document.getElementById("TextBoxId").disabled = true;
47. To write text to the current element of the DOM
Two forward slashes "//"
Math.random() //Returns a value >= 0.0 but <1.0
Math.min(var1, var2, varN)
document.write("Text Here") //Remains on current line
48. To get the value or the currently selected item for lists
Multi line
alert("Alert Text Here")
toLowerCase()
document.getElementById("listId").value;
49. String object method used to return the position of the first instance of a specified search string starting from the specified index
'
indexOf(searchValue, startPosition)
for (counter; condition; incrementor) {}
charAt(position)
50. Math object method used to return the highest value from a set of supplied numbers
document.getElementById("TextBoxId").focus;
var functionName = function(param1, param2, paramN) {}
Math.max(var1, var2, varN)
substring(startIndex)