why oky

Topics: String, Variables, Cascading Style Sheets Pages: 3 (304 words) Published: April 17, 2014


Lab Quiz # 1
(JavaScript and CSS)

Instructions

Please go through the instructions very carefully.

Submit the same document by renaming it with your roll number In case of cheating, -3 abs would be awarded in lab
Write answer below each question e.g. “option A”

Exercise 1
JavaScript Section

1. How do you call a function named "myFunction"?

A.
call function myFunction
B.
call myFunction()
C.
myFunction()
Option: C

2.
What would be output of alert?
var _$te$t2;
_$te$t2 = ‘my value ’;
_$te$t2 = _$te$t2 + 12

Alert(_$te$t2;)

A.
Variable not valid
B.
my value12
C.
None of above

Option: B

3.
When value is declared but not initialized, by default value assigned to it is

A.
null
B.
Empty string
C.
undefined

Option: A

4.
What would be output of alert?
var t2 = 10.2;
alert(t2.toString());

A.
10.2
B.
Type mismatch error
C.
10

Option: A

5.
What would be output of alert?
var myTemp = ‘hello world’
alert(myTemp.lastIndexOf(“o”)-1);

A.
8
B.
7
C.
None of above

Option: B

6.
What would be output of alert?
var myTemp = 12;
var myTemp2 = 1;

var finalTemp = myTemp2-- + myTemp++
alert(finalTemp)

A.
15
B.
13
C.
11

Option: C

7.
What would be output of alert?
function sum(iNum1, iNum2) {
return iNum1 + iNum2;
alert(iNum1 + iNum2);
}

var iResult = sum(1,1);

A.
2
B.
Type mismatch error
C.
None of above

Option: C
CSS Section
8.
What i s the correct syntax for removing the default underline from links?

A.
a { text-decoration: none; }

B.
a {underline: none}

C.
link { text-decoration: none; }

Option: B

9.
Which of the following is the proper syntax for linking to an external stylesheet in HTML?

A.

B.
href=”style.css”
C.

D.

Option: A

10.
Which of the following is NOT an advantage of CSS defined for the entire site?

A.
Prettier colors
B....
Continue Reading

Please join StudyMode to read the full document

You May Also Find These Documents Helpful

  • how to speak giraffe Essay
  • Essay on 13 Reasons Why Review
  • The 5 Whys Analysis Method Essay
  • Essay about The River Why
  • 13 Reason Why Essay
  • An Analysis of George Orwell's Essay "Why I Write"
  • Essay on I Know Why the Caged Birds Sing
  • I Know Why the Caged Bird Sings Essay

Become a StudyMode Member

Sign Up - It's Free