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 focus on the control for textboxes
\
sensitive
document.getElementById("TextBoxId").focus;
setMilliseconds()
2. String object method used to return a new string that contains part of the original string from the specified start position
var arrayVar = new Array()
"
substring(startIndex)
var functionName = function(param1, param2, paramN) {}
3. When you add a string and a number the result will be a ____
substring(startIndex)
\
confirm()
string
4. To assign the value from a prompt to a non-string variable
Charset
Math.ceil(number)
var arrayVar = new Array()
Use a parse. Example : var intVar = parseInt(prompt("Text Here"))
5. When you __________ a javascript variable it retains its original value
Math.round(number)
getFullYear()
redeclare
Multi line
6. To get the text value of the control for radio buttons
Math.ceil(number)
getTime()
document.getElementById("checkboxId").value;
substring(startIndex)
7. The string escape sequence to insert a vertical tab in JavaScript
expression
confirm()
v
toLowerCase()
8. To access a page element by id
semicolon ";"
getTime()
document.getElementById(id)
document.getElementById("radioButtonId").value;
9. To create an Array object in JavaScript
var arrayVar = new Array()
getFullYear()
for (counter; condition; incrementor) {}
redeclare
10. The _____ attribute is used to denote external file for script use
event handler .
Number.NEGATIVE_INFINITY
Math.pow(number, power)
Src - e.g. <script src="fileName.js"> //
11. Command to display a prompt
var arrayVar = new Array()
toPrecision(precision)
Math.ceil(number)
prompt("Text Here")
12. To get the value or the currently selected item for lists
while (condition) {}
document.getElementById("listId").value;
document.writeln("Text Here") //Advances to new line after text
toFixed(digits)
13. Math object method used to return the absolute value of a given number
Math.abs(number)
Math.random() //Returns a value >= 0.0 but <1.0
standard equality operators
document.getElementById("ButtonId").onclick = functionName;
14. To set the current checked status of the control for checkboxes
document.getElementById("CheckboxId").checked = true; //Could also be false
var dateObject = new Date("11/22/2012 18:25:35")
var stringVar = prompt("Text Here")
document.getElementById("spanId").firstChild;
15. A statement that yields a value
Src - e.g. <script src="fileName.js"> //
var variableName;
toString()
expression
16. The format to create a new Date object from a string
document.getElementById("radioButtonId").checked = true; //Could also be false
Objects
var dateObject = new Date("11/22/2012 18:25:35")
document.getElementById("textAreaId").value;
17. To create a Date object in JavaScript
toUpperCase()
var dateVar = new Date()
<script type="text/javascript">.....</script>
window.location = "New Web Address Here";
18. The identity operator for equals
Math.abs(number)
if (condition) {}
===
Math.ceil(number)
19. To create a function in JavaScript
var functionName = function(param1, param2, paramN) {}
prompt("Text Here")
document.getElementById("checkboxId").checked;
Charset
20. The available properties for the Number object: Number.MAX_VALUE - Number.MIN_VALUE - Number.POSITIVE_INFINITY - _______ - Number.NaN
Number.NEGATIVE_INFINITY
document.getElementById("spanId").firstChild;
document.getElementById("CheckboxId").checked = true; //Could also be false
toLowerCase()
21. To get the current value of the control for a text area
Math.abs(number)
document.getElementById("textAreaId").value;
string
<script type="text/javascript">.....</script>
22. To code a for statement in JavaScript
===
"
for (counter; condition; incrementor) {}
document.getElementById("spanId").firstChild.nodeValue = "New Value";
23. Math object method used to return a given number that has been rounded to the closes integer value
alert("Alert Text Here")
Math.abs(number)
substring(startIndex, stopIndex)
Math.round(number)
24. The identity operator for not equal
!==
n
Math.random() //Returns a value >= 0.0 but <1.0
expression
25. The events common to most controls: onfocus - onblur - onclick - _______ - onchange - onselect
toDateString()
document.getElementById("radioButtonId").checked = true; //Could also be false
ondblclick
global
26. String object method used to concatenate multiple strings
concat(var1, var2, varN)
setMilliseconds()
Math.random() //Returns a value >= 0.0 but <1.0
===
27. The available get methods for a Date object: getTime() - _________ - getMonth() - getDate() - getHours() - getMinutes() - getSeconds() - getMilliseconds()
toExponential(digits)
getFullYear()
Math.ceil(number)
Src - e.g. <script src="fileName.js"> //
28. Math object method used to return a random number
Charset
Math.random() //Returns a value >= 0.0 but <1.0
var variableName;
focus
29. Date object method used to return a string containing the date
toDateString()
indexOf(searchValue, startPosition)
f
r
30. To assign the value from a prompt to a string
expression
var stringVar = prompt("Text Here")
document.getElementById("ButtonId").onclick = functionName;
toUpperCase()
31. The available set methods for a Date object: setFullYear() - setMonth() - setDate() - setHours() - setMinutes() - setSeconds() - _________
setMilliseconds()
Use a parse. Example : var intVar = parseInt(prompt("Text Here"))
toTimeString()
(Condition_Expression) ? Value_If_True : Value_If_False;
32. To code an If statement in JavaScript
if (condition) {}
sensitive
ondblclick
getFullYear()
33. To set the current checked status of the control for radio buttons
document.getElementById("radioButtonId").checked = true; //Could also be false
Multi line
substring(startIndex, stopIndex)
setMilliseconds()
34. To display an alert
!==
var functionName = function(param1, param2, paramN) {}
n
alert("Alert Text Here")
35. To get the text value of the control for radio buttons
Charset
isNaN(varHere) //Returns true or false.
var dateVar = new Date()
document.getElementById("radioButtonId").value;
36. To assign the return value of confirm() to a variable
"
document.getElementById("checkboxId").checked;
var answerVar = confirm("Message Text Here")
var arrayVar = new Array()
37. To access the text element in a <span> tag
document.getElementById("spanId").firstChild;
toDateString()
udddd
Math.random() //Returns a value >= 0.0 but <1.0
38. Number object method used to return a numerical string with the specified number of significant digits
toPrecision(precision)
document.getElementById("CheckboxId").checked = true; //Could also be false
r
document.write("Text Here") //Remains on current line
39. 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
Multi line
document.getElementById("radioButtonId").checked = true; //Could also be false
expression
substring(startIndex, stopIndex)
40. To display a confirmation
toUpperCase()
document.getElementById("textAreaId").value;
confirm("Message Text Here")
var variableName;
41. The valid characters for an identifier in JavaScript: Letters - Numbers - ________ and Dollar Signs
Math.random() //Returns a value >= 0.0 but <1.0
document.getElementById("listId").value;
setMilliseconds()
Underscores
42. The string escape sequence to insert a backslash in JavaScript
substring(startIndex, stopIndex)
toFixed(digits)
document.write("Text Here") //Remains on current line
\
43. The string escape sequence to insert a single quote in JavaScript
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
44. To concatenate multiple parts into a string
Use a parse. Example : var intVar = parseInt(prompt("Text Here"))
var stringVar = "part 1:" + "part 2";
document.getElementById("listId").value;
<noscript>
45. To code a while statement in JavaScript
charAt(position)
setMilliseconds()
while (condition) {}
document.write("Text Here") //Remains on current line
46. To assign actions to the window onLoad event
Charset
window.onload = function() {//actions here}
document.getElementById("listId").value;
toLowerCase()
47. String object method used to get the character at a specified index position
window.location = "New Web Address Here";
var dateObject = new Date("11/22/2012 18:25:35")
!==
charAt(position)
48. To create a new Date object
Underscores
Use a parse. Example : var intVar = parseInt(prompt("Text Here"))
Math.floor(number)
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
49. To get the current checked status of the control for checkboxes
toDateString()
document.getElementById("checkboxId").checked;
<script type="text/javascript">.....</script>
document.write("Text Here") //Remains on current line
50. To alter the value of the text element in a span tag
Use the second parameter. Example: prompt("Enter Age:", "18")
document.getElementById("radioButtonId").value;
document.getElementById("spanId").firstChild.nodeValue = "New Value";
===