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 display an alert
toFixed(digitCount)
document.getElementById("CheckboxId").checked = true; //Could also be false
Underscores
alert("Alert Text Here")
2. Date object method used to return a string containing the date and time
document.getElementById("TextBoxId").focus;
document.writeln("Text Here") //Advances to new line after text
toString()
alert("Alert Text Here")
3. To access the text element in a <span> tag
===
Src - e.g. <script src="fileName.js"> //
expression
document.getElementById("spanId").firstChild;
4. To set the digit precision of a decimal number
(Condition_Expression) ? Value_If_True : Value_If_False;
setMilliseconds()
toFixed(digitCount)
Math.floor(number)
5. To create a function in JavaScript
document.getElementById("radioButtonId").checked;
var functionName = function(param1, param2, paramN) {}
r
Multi line
6. The string escape sequence to insert a tab in JavaScript
prompt("Text Here")
alert("Alert Text Here")
t
document.getElementById("spanId").firstChild;
7. To assign actions to the window onLoad event
window.onload = function() {//actions here}
Math.random() //Returns a value >= 0.0 but <1.0
Math.round(number)
toExponential(digits)
8. 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
toString()
Math.floor(number)
substring(startIndex, stopIndex)
document.getElementById("CheckboxId").checked = true; //Could also be false
9. To declare a variable in JavaScript
var stringVar = "part 1:" + "part 2";
focus
var variableName;
Objects
10. To get the current value for textboxes
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
document.getElementById("TextBoxId").value;
document.getElementById("radioButtonId").checked;
global
11. The valid characters for an identifier in JavaScript: Letters - Numbers - ________ and Dollar Signs
(Condition_Expression) ? Value_If_True : Value_If_False;
Math.ceil(number)
window.location = "New Web Address Here";
Underscores
12. The available properties for the Number object: Number.MAX_VALUE - Number.MIN_VALUE - Number.POSITIVE_INFINITY - _______ - Number.NaN
Math.floor(number)
<script type="text/javascript">.....</script>
Number.NEGATIVE_INFINITY
document.getElementById("CheckboxId").checked = true; //Could also be false
13. To assign the return value of confirm() to a variable
toString()
Objects
var answerVar = confirm("Message Text Here")
===
14. To get the text value of the control for radio buttons
Charset
document.getElementById("checkboxId").value;
document.getElementById("CheckboxId").checked = true; //Could also be false
var stringVar = "part 1:" + "part 2";
15. To concatenate multiple parts into a string
Charset
toPrecision(precision)
var stringVar = "part 1:" + "part 2";
charAt(position)
16. The available set methods for a Date object: setFullYear() - setMonth() - setDate() - setHours() - setMinutes() - setSeconds() - _________
Src - e.g. <script src="fileName.js"> //
Math.min(var1, var2, varN)
Use the second parameter. Example: prompt("Enter Age:", "18")
setMilliseconds()
17. A _______ variable can be changed and accessed from within and without a function or object.
n
var stringVar = "part 1:" + "part 2";
global
prompt("Text Here")
18. What String object method returns a new string containing the value of the original string but in all lower case
===
toUpperCase()
toLowerCase()
focus
19. The string escape sequence to start a new line in JavaScript
if (condition) {}
n
focus
isNaN(varHere) //Returns true or false.
20. To write text to the current element of the DOM
document.write("Text Here") //Remains on current line
Use the second parameter. Example: prompt("Enter Age:", "18")
string
document.getElementById("radioButtonId").checked;
21. Math object method used to return a random number
document.getElementById("TextBoxId").value;
Multi line
var arrayVar = new Array()
Math.random() //Returns a value >= 0.0 but <1.0
22. To get the current value of the control for a text area
document.getElementById("textAreaId").value;
Math.sqrt(number)
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
event handler .
23. String object method used to return the position of the first instance of a specified search string starting from the specified index
document.getElementById("checkboxId").checked;
document.getElementById("spanId").firstChild.nodeValue = "New Value";
var arrayVar = new Array()
indexOf(searchValue, startPosition)
24. The format to create a new Date object from a string
var dateObject = new Date("11/22/2012 18:25:35")
Math.ceil(number)
<script type="text/javascript">.....</script>
confirm()
25. The two methods common to most controls: ______ //Brings focus to the control blur //Removes focus from the control
isNaN(varHere) //Returns true or false.
if (condition) {}
Either single or double quotes surrounding the data
focus
26. Number object method used to return a numerical string with the specified number of significant digits
Use the second parameter. Example: prompt("Enter Age:", "18")
if (condition) {}
===
toPrecision(precision)
27. To denote a string in JavaScript
Either single or double quotes surrounding the data
setMilliseconds()
confirm()
while (condition) {}
28. To get the text value of the control for radio buttons
window.onload = function() {//actions here}
var functionName = function(param1, param2, paramN) {}
document.getElementById("radioButtonId").value;
toLowerCase()
29. This returns only True or false values
charAt(position)
Charset
document.getElementById("checkboxId").checked;
confirm()
30. To assign a default value to a prompt
v
'
t
Use the second parameter. Example: prompt("Enter Age:", "18")
31. Math object method used to return the highest value from a set of supplied numbers
Math.max(var1, var2, varN)
<noscript>
standard equality operators
document.getElementById("listId").value;
32. To create a function that returns a value in JavaScript
Math.pow(number, power)
string
var functionName = function(param1, param2, paramN) {}
Use the second parameter. Example: prompt("Enter Age:", "18")
33. The string escape sequence to insert a form feed in JavaScript
ondblclick
standard equality operators
f
alert("Alert Text Here")
34. To view the current web address using JavaScript
window.location()
document.getElementById("checkboxId").checked;
Use the second parameter. Example: prompt("Enter Age:", "18")
v
35. Date object method used to return a string containing the time
document.getElementById("checkboxId").checked;
toString(base)
toTimeString()
document.getElementById("TextBoxId").focus;
36. Math object method used to return a given number rounded to the next lowest integer value
Math.floor(number)
Math.min(var1, var2, varN)
sensitive
Math.max(var1, var2, varN)
37. Command to display a prompt
setMilliseconds()
prompt("Text Here")
Either single or double quotes surrounding the data
event handler .
38. The four attributes of the <script> tag:Type - Src - _____ and Defer
semicolon ";"
sensitive
Charset
confirm("Message Text Here")
39. To create an Array object in JavaScript
while (condition) {}
ondblclick
var arrayVar = new Array()
Math.ceil(number)
40. The escape sequence used to insert a Unicode character into a string in JavaScript
toPrecision(precision)
udddd
document.getElementById("TextBoxId").disabled = true;
window.location()
41. Date object method used to return a string containing the date
redeclare
toDateString()
alert("Alert Text Here")
document.writeln("Text Here") //Advances to new line after text
42. Math object method used to return a given number that has been rounded to the closes integer value
Math.round(number)
charAt(position)
for (counter; condition; incrementor) {}
var arrayVar = new Array()
43. A statement that yields a value
string
Multi line
getFullYear()
expression
44. To insert Javascript into a web page
document.getElementById("radioButtonId").checked = true; //Could also be false
document.getElementById("TextBoxId").disabled = true;
standard equality operators
<script type="text/javascript">.....</script>
45. To set the current checked status of the control for radio buttons
var stringVar = "part 1:" + "part 2";
document.getElementById("listId").value;
document.writeln("Text Here") //Advances to new line after text
document.getElementById("radioButtonId").checked = true; //Could also be false
46. The events common to most controls: onfocus - onblur - onclick - _______ - onchange - onselect
var arrayVar = new Array()
ondblclick
document.getElementById("checkboxId").checked;
substring(startIndex)
47. What String object method returns a new string containing the value of the original string but in all upper case
toUpperCase()
global
"
(Condition_Expression) ? Value_If_True : Value_If_False;
48. Number object method used to return a string with a given number base
toString(base)
document.getElementById("radioButtonId").checked;
\
document.getElementById("listId").value;
49. To set the control to be disabled for textboxes
semicolon ";"
document.getElementById("spanId").firstChild;
global
document.getElementById("TextBoxId").disabled = true;
50. Number object method used to return a number in exponential format with the specified number of decimal places
t
var stringVar = "part 1:" + "part 2";
toExponential(digits)
redeclare