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