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