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