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 _____ attribute is used to denote external file for script use
document.getElementById("radioButtonId").checked;
udddd
confirm()
Src - e.g. <script src="fileName.js"> //
2. A function that is called with a certain event occurs - e.g. button.onclick and window.onload.
confirm()
string
event handler .
toExponential(digits)
3. To create a new Date object
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
getFullYear()
t
Number.NEGATIVE_INFINITY
4. To get the current checked status of the control for checkboxes
Use the second parameter. Example: prompt("Enter Age:", "18")
indexOf(searchValue, startPosition)
substring(startIndex)
document.getElementById("checkboxId").checked;
5. Number object method used to return a string with a given number base
global
document.getElementById("radioButtonId").checked;
ondblclick
toString(base)
6. Number object method used to return a number in exponential format with the specified number of decimal places
toFixed(digits)
Either single or double quotes surrounding the data
prompt("Text Here")
toExponential(digits)
7. To set the current value of the control for a text area
document.getElementById("textAreaId").value = "Text Value";
standard equality operators
var dateVar = new Date()
document.getElementById("spanId").firstChild;
8. To access the text element in a <span> tag
document.getElementById("spanId").firstChild;
confirm("Message Text Here")
charAt(position)
toFixed(digits)
9. To assign a default value to a prompt
t
Use the second parameter. Example: prompt("Enter Age:", "18")
window.location = "New Web Address Here";
while (condition) {}
10. Math object method used to return a given number raised to a given power
Math.pow(number, power)
document.getElementById("checkboxId").value;
\
for (counter; condition; incrementor) {}
11. What String object method returns a new string containing the value of the original string but in all upper case
Either single or double quotes surrounding the data
toUpperCase()
substring(startIndex)
var arrayVar = new Array()
12. To create a function in JavaScript
udddd
Math.pow(number, power)
var functionName = function(param1, param2, paramN) {}
alert("Alert Text Here")
13. Number object method used to return a numerical string with the specified number of significant digits
alert("Alert Text Here")
toPrecision(precision)
document.getElementById("radioButtonId").value;
var answerVar = confirm("Message Text Here")
14. To alter the value of the text element in a span tag
alert("Alert Text Here")
toFixed(digitCount)
document.getElementById("spanId").firstChild.nodeValue = "New Value";
document.writeln("Text Here") //Advances to new line after text
15. To denote a string in JavaScript
concat(var1, var2, varN)
Either single or double quotes surrounding the data
document.getElementById(id)
toFixed(digits)
16. To get the text value of the control for radio buttons
document.getElementById("spanId").firstChild;
for (counter; condition; incrementor) {}
document.getElementById("radioButtonId").checked = true; //Could also be false
document.getElementById("radioButtonId").value;
17. To get the value or the currently selected item for lists
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
document.getElementById("listId").value;
"
substring(startIndex)
18. The ________ tag is used to display the text between the opening and closing tag if JavaScript is disabled or otherwise not available
string
document.write("Text Here") //Remains on current line
document.getElementById("checkboxId").value;
<noscript>
19. ________ comments start with / and end with /.
Number.NEGATIVE_INFINITY
setMilliseconds()
<noscript>
Multi line
20. To make the browser load a new page using JavaScript
toFixed(digits)
window.location = "New Web Address Here";
expression
Math.random() //Returns a value >= 0.0 but <1.0
21. To display a confirmation
sensitive
confirm("Message Text Here")
v
toUpperCase()
22. Math object method used to return a given number that has been rounded to the closes integer value
Math.floor(number)
substring(startIndex)
Math.round(number)
var stringVar = "part 1:" + "part 2";
23. The string escape sequence to insert a backslash in JavaScript
confirm("Message Text Here")
\
Multi line
var stringVar = "part 1:" + "part 2";
24. Date object method used to return a string containing the date
if (condition) {}
document.getElementById("CheckboxId").checked = true; //Could also be false
toDateString()
n
25. Math object method used to return the absolute value of a given number
setMilliseconds()
<script type="text/javascript">.....</script>
document.getElementById("TextBoxId").focus;
Math.abs(number)
26. To create a function that returns a value in JavaScript
for (counter; condition; incrementor) {}
n
var functionName = function(param1, param2, paramN) {}
while (condition) {}
27. Command to display a prompt
prompt("Text Here")
document.getElementById("radioButtonId").checked;
v
string
28. To assign the value from a prompt to a non-string variable
Use a parse. Example : var intVar = parseInt(prompt("Text Here"))
t
toFixed(digits)
getFullYear()
29. To get the current checked status of the control for radio buttons
var functionName = function(param1, param2, paramN) {}
var functionName = function(param1, param2, paramN) {}
document.getElementById("radioButtonId").checked;
Math.ceil(number)
30. The available properties for the Number object: Number.MAX_VALUE - Number.MIN_VALUE - Number.POSITIVE_INFINITY - _______ - Number.NaN
var variableName;
Math.abs(number)
getTime()
Number.NEGATIVE_INFINITY
31. Math object method used to return a given number rounded to the next lowest integer value
===
Math.floor(number)
Math.max(var1, var2, varN)
document.write("Text Here") //Remains on current line
32. To declare a variable in JavaScript
substring(startIndex)
document.getElementById("textAreaId").value = "Text Value";
var variableName;
<script type="text/javascript">.....</script>
33. The format to create a new Date object from a string
var dateObject = new Date("11/22/2012 18:25:35")
r
substring(startIndex, stopIndex)
toString(base)
34. Math object method used to return the square root of a given number
Math.sqrt(number)
window.location()
getFullYear()
document.getElementById("textAreaId").value = "Text Value";
35. To assign actions to the window onLoad event
confirm("Message Text Here")
window.onload = function() {//actions here}
Math.random() //Returns a value >= 0.0 but <1.0
setMilliseconds()
36. To concatenate multiple parts into a string
Number.NEGATIVE_INFINITY
for (counter; condition; incrementor) {}
var stringVar = "part 1:" + "part 2";
document.getElementById("textAreaId").value = "Text Value";
37. The string escape sequence to insert a form feed in JavaScript
document.getElementById("textAreaId").value;
Objects
f
alert("Alert Text Here")
38. Number object method used to round numbers to the specified number of decimal places
Charset
string
toFixed(digits)
alert("Alert Text Here")
39. To set the current checked status of the control for radio buttons
t
document.getElementById("radioButtonId").checked = true; //Could also be false
Math.pow(number, power)
var dateObject = new Date("11/22/2012 18:25:35")
40. Math object method used to return the lowest value for a set of supplied numbers
toFixed(digitCount)
!==
Math.min(var1, var2, varN)
var dateObject = new Date("11/22/2012 18:25:35")
41. To set the digit precision of a decimal number
standard equality operators
while (condition) {}
toFixed(digitCount)
var dateObject = new Date("11/22/2012 18:25:35")
42. The syntax of a conditional operator
(Condition_Expression) ? Value_If_True : Value_If_False;
Use the second parameter. Example: prompt("Enter Age:", "18")
window.location()
f
43. Math object method used to return a given number rounded to the next highest integer value
document.getElementById("CheckboxId").checked = true; //Could also be false
Math.ceil(number)
window.location()
n
44. When you __________ a javascript variable it retains its original value
Use a parse. Example : var intVar = parseInt(prompt("Text Here"))
redeclare
Math.pow(number, power)
var functionName = function(param1, param2, paramN) {}
45. To access a page element by id
Objects
(Condition_Expression) ? Value_If_True : Value_If_False;
document.getElementById(id)
var dateObject = new Date("11/22/2012 18:25:35")
46. String object method used to concatenate multiple strings
if (condition) {}
concat(var1, var2, varN)
toLowerCase()
document.getElementById("textAreaId").value;
47. 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
48. The two methods common to most controls: ______ //Brings focus to the control blur //Removes focus from the control
Math.round(number)
var answerVar = confirm("Message Text Here")
focus
document.getElementById("CheckboxId").checked = true; //Could also be false
49. To create a single line comment in JavaScript
Two forward slashes "//"
while (condition) {}
Use the second parameter. Example: prompt("Enter Age:", "18")
<noscript>
50. The available get methods for a Date object: getTime() - _________ - getMonth() - getDate() - getHours() - getMinutes() - getSeconds() - getMilliseconds()
document.getElementById("ButtonId").onclick = functionName;
getFullYear()
===
document.getElementById("TextBoxId").value;