Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

Which one of the following is an ternary operator___________

a) +
b) ?
c) :
d)  – 

How do you create a function in JavaScript?


a) function = myFunction()
b) function:myFunction()
c) function myFunction()
d) function =myFunction {}

What will be the output of the following JavaScript code?


var grade='E';
switch(grade)
{ case 'A':
document.write("12");
case 'B':
document.write("10");
case 'C':
document.write("9");
default:
document.write("0");}
a) 10
b) 0
c) 9
d) 12

Which of the following number object function returns the value of the number? 
a) valueOf()
b) toString()
c) toLocaleString()
d) DtoPrecision()
 Which of the following object function returns the data type of the variable? 
a) valueOf()
b) toint()
c) todouble()
d) typeof()
In JavaScript the x===y statement implies that____________
a) Both are equal in the value and data type
b) Both are not same at all
c) Both are x and y are equal in value only
d) Both x and y are equal in value, type and reference address as well
 Choose the correct snippet from the following to check if the variable “a” is not equal the
“NULL”_______
a) if(a!==null)
b) if (a!)
c) if(a!=null)
d) if(a!null)
Which one of the following is not a keyword__________
a) with
b)  if
c) debugger
d) use strict
Which one of the following operator returns false if both values are equal?
a) ==
b) !==
c) !
d) &&

Which of the following methods is used to access HTML elements using Javascript?
a) getElementby()
b) getTagId()
c) getElementbyId()
d) None of the above

Which of the following methods can be used to display data in some form using Javascript?
a) document.write()
b) console.log()
c) alert()
d) All of the above
What will be the output of the following code snippet? a = 5 + "9";alert(a);
a) Compilation Error
b) 14
c) Runtime Error
b) 59
Which of the following that write in tag html ?
a) document.getElementById("example")=”welc”
b) document.getElementById("example").innerHTML=”welc”
c) console.log(”welc”)
d) alert(“welc)
What will be the output ? print(parseInt("123Hello"));
a) 123
b) 123Hello
c) 123 NaN
b) NaN NaN
How do we write a comment in javascript?
a) /* */
b) //
c) #
d) $ $
What is the correct syntax ? <p id="demo">This is a demonstration.</p>
a) document.getElementById("demo").innerHTML = "Hello World!";
b) document.getElementById("demo").innerHTML = "Hello World!";
c) #demo.innerHTML = "Hello World!";
d) document.getElement("p").innerHTML = "Hello World!";
What is the correct syntax for referring to an external script called "xxx.js"?
a) <script name="xxx.js">
b) <script href="xxx.js">
c) <script src="xxx.js">
d) <script link="xxx.js">

which of the following methods/operation does javascript use instead of == and !=?

a) JavaScript uses equalto()


b) JavaScript uses equals() and notequals() instead
c) JavaScript uses bitwise checking
d) JavaScript uses === and !== instead

CSS AND HTml Questions


To remove underline in hyperlink we use ?
a) text-decoration: overline;
b) text-decoration: underline;
c) text-decoration: underline overline;
d) text-decoration: none;
Which of the following CSS selectors are used to specify a group of elements?

a) tag
b) id
c) class
d) both class and tag
Which of the following CSS property is used to make the text bold?

a) text-decoration: bold
b) font-weight: bold
c) font-style: bold
d) text-align: bold

Which of the following is the correct syntax to select all paragraph elements in a div
element?

a. div p
b. p
c. div#p
d. div ~ p

Which of the following is the correct syntax to link an external style sheet in the
HTML file?

a) <link rel=”stylesheet” href=”style.css” />


b) <link rel=”stylesheet” src=”style.css” />
c) <style rel=”stylesheet” src=”style.css” />
d) <style rel=”stylesheet” link=”style.css” />  
How to select the elements with the ID name "example"?
a) example
b) #example
c) .example
d) class example
Which type of CSS is used in the below code?
a) Inline CSS
b) Internal CSS
c) External CSS
d) none of the above

Which of the following CSS Property sets the stacking order of positioned
elements?

a) y-index
b) z-index
c) x-index
d) all of the mentioned
Which of the following tags do not require a terminator

a) <u>
b) <br>
c) <b>
d) none of the above

 to get the ordered list we use?

A) <HI>
B) <UL>
C) <OL>
D) <ML>

You might also like