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. Math object method used to return a given number rounded to the next highest integer value
event handler .
Math.ceil(number)
var variableName;
(Condition_Expression) ? Value_If_True : Value_If_False;
2. The syntax of a conditional operator
Math.abs(number)
document.getElementById("checkboxId").checked;
confirm("Message Text Here")
(Condition_Expression) ? Value_If_True : Value_If_False;
3. Number object method used to return a string with a given number base
toString(base)
Math.pow(number, power)
var variableName;
redeclare
4. To create a single line comment in JavaScript
event handler .
window.location()
Src - e.g. <script src="fileName.js"> //
Two forward slashes "//"
5. To access a page element by id
document.writeln("Text Here") //Advances to new line after text
document.getElementById(id)
semicolon ";"
confirm()
6. What String object method returns a new string containing the value of the original string but in all lower case
toLowerCase()
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
standard equality operators
Math.floor(number)
7. The string escape sequence to start a new line in JavaScript
Use the second parameter. Example: prompt("Enter Age:", "18")
n
document.getElementById("CheckboxId").checked = true; //Could also be false
Math.sqrt(number)
8. The format to create a new Date object from a string
var dateObject = new Date("11/22/2012 18:25:35")
<script type="text/javascript">.....</script>
for (counter; condition; incrementor) {}
\
9. Command to display a prompt
prompt("Text Here")
Src - e.g. <script src="fileName.js"> //
===
n
10. Math object method used to return a random number
document.getElementById("radioButtonId").checked = true; //Could also be false
document.getElementById("spanId").firstChild;
Math.random() //Returns a value >= 0.0 but <1.0
document.getElementById("spanId").firstChild.nodeValue = "New Value";
11. The events common to most controls: onfocus - onblur - onclick - _______ - onchange - onselect
var stringVar = "part 1:" + "part 2";
r
ondblclick
document.getElementById("CheckboxId").checked = true; //Could also be false
12. JavaScript is case _______
toLowerCase()
toString()
Math.random() //Returns a value >= 0.0 but <1.0
sensitive
13. What Date object method is used to return the number of milliseconds since the start of GMT
getTime()
redeclare
'
document.getElementById("textAreaId").value;
14. The string escape sequence to insert a carriage return in JavaScript
standard equality operators
r
expression
Number.NEGATIVE_INFINITY
15. A statement that yields a value
toFixed(digits)
Underscores
Math.ceil(number)
expression
16. To insert Javascript into a web page
substring(startIndex)
<script type="text/javascript">.....</script>
Use the second parameter. Example: prompt("Enter Age:", "18")
window.onload = function() {//actions here}
17. To display an alert
document.write("Text Here") //Remains on current line
alert("Alert Text Here")
window.location = "New Web Address Here";
semicolon ";"
18. To code a button.onclick event handler
document.getElementById("radioButtonId").checked;
substring(startIndex)
document.getElementById("ButtonId").onclick = functionName;
n
19. To get the current value of the control for a text area
document.getElementById("textAreaId").value = "Text Value";
window.onload = function() {//actions here}
Math.sqrt(number)
document.getElementById("textAreaId").value;
20. To write a line to the current element of the DOM (Document Object Model)
document.writeln("Text Here") //Advances to new line after text
document.getElementById("TextBoxId").value;
semicolon ";"
Math.round(number)
21. To assign a default value to a prompt
Use the second parameter. Example: prompt("Enter Age:", "18")
document.getElementById("textAreaId").value;
window.onload = function() {//actions here}
var dateObject = new Date("11/22/2012 18:25:35")
22. To code a for statement in JavaScript
for (counter; condition; incrementor) {}
n
concat(var1, var2, varN)
Number.NEGATIVE_INFINITY
23. 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
24. A _______ variable can be changed and accessed from within and without a function or object.
prompt("Text Here")
document.getElementById(id)
Multi line
global
25. To set focus on the control for textboxes
document.getElementById("TextBoxId").value;
document.getElementById("TextBoxId").focus;
Math.ceil(number)
standard equality operators
26. To alter the value of the text element in a span tag
document.getElementById("spanId").firstChild.nodeValue = "New Value";
Math.round(number)
Multi line
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
27. To code an If statement in JavaScript
expression
if (condition) {}
r
!==
28. To denote a string in JavaScript
Either single or double quotes surrounding the data
document.getElementById("textAreaId").value;
setMilliseconds()
for (counter; condition; incrementor) {}
29. Math object method used to return the lowest value for a set of supplied numbers
toString(base)
Objects
Math.min(var1, var2, varN)
document.getElementById("TextBoxId").value;
30. The available set methods for a Date object: setFullYear() - setMonth() - setDate() - setHours() - setMinutes() - setSeconds() - _________
document.getElementById(id)
confirm("Message Text Here")
focus
setMilliseconds()
31. The identity operator for not equal
confirm("Message Text Here")
t
!==
expression
32. 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
substring(startIndex, stopIndex)
===
Math.random() //Returns a value >= 0.0 but <1.0
var variableName;
33. To set the current checked status of the control for radio buttons
toDateString()
Two forward slashes "//"
document.getElementById("TextBoxId").focus;
document.getElementById("radioButtonId").checked = true; //Could also be false
34. The string escape sequence to insert a backslash in JavaScript
string
\
Objects
var dateObject = new Date("11/22/2012 18:25:35")
35. To display a confirmation
Math.max(var1, var2, varN)
<script type="text/javascript">.....</script>
confirm("Message Text Here")
window.location = "New Web Address Here";
36. The string escape sequence to insert a vertical tab in JavaScript
toExponential(digits)
v
standard equality operators
var arrayVar = new Array()
37. To view the current web address using JavaScript
window.location()
isNaN(varHere) //Returns true or false.
var arrayVar = new Array()
document.getElementById("textAreaId").value = "Text Value";
38. The string escape sequence to insert a form feed in JavaScript
concat(var1, var2, varN)
f
Two forward slashes "//"
toFixed(digitCount)
39. The ________ tag is used to display the text between the opening and closing tag if JavaScript is disabled or otherwise not available
<noscript>
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
substring(startIndex, stopIndex)
indexOf(searchValue, startPosition)
40. To access the text element in a <span> tag
document.getElementById("spanId").firstChild;
document.getElementById("radioButtonId").checked;
sensitive
var functionName = function(param1, param2, paramN) {}
41. String object method used to return the position of the first instance of a specified search string starting from the specified index
indexOf(searchValue, startPosition)
document.getElementById("textAreaId").value;
document.getElementById("checkboxId").checked;
concat(var1, var2, varN)
42. To get the current value for textboxes
Use a parse. Example : var intVar = parseInt(prompt("Text Here"))
document.getElementById("TextBoxId").value;
substring(startIndex, stopIndex)
Charset
43. To declare a variable in JavaScript
===
document.getElementById("TextBoxId").focus;
var variableName;
concat(var1, var2, varN)
44. A function that is called with a certain event occurs - e.g. button.onclick and window.onload.
var functionName = function(param1, param2, paramN) {}
event handler .
r
document.getElementById("spanId").firstChild;
45. To create a new Date object
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
toDateString()
focus
document.getElementById("spanId").firstChild;
46. Date object method used to return a string containing the date
toDateString()
sensitive
var stringVar = "part 1:" + "part 2";
concat(var1, var2, varN)
47. The identity operator for equals
===
document.getElementById("textAreaId").value = "Text Value";
toFixed(digits)
Number.NEGATIVE_INFINITY
48. To set the digit precision of a decimal number
toPrecision(precision)
document.getElementById("spanId").firstChild.nodeValue = "New Value";
toFixed(digitCount)
prompt("Text Here")
49. A list-like construct that has properties which corresponds to JavaScript values or variables or other objects.
document.getElementById("TextBoxId").focus;
Objects
udddd
document.getElementById("ButtonId").onclick = functionName;
50. The valid characters for an identifier in JavaScript: Letters - Numbers - ________ and Dollar Signs
var variableName;
prompt("Text Here")
Underscores
n