Home

JavaScript MCQ Question with Answer

JavaScript MCQ with detailed explanation for interview, entrance and competitive exams. Explanation are given for understanding.

Download JavaScript MCQ Question Answer PDF

Question No : 8
JavaScript can be written __________

directly into JS file and included into HTML
directly on the server page
directly into HTML pages
directly into the css file

Question No : 9
Which of the following Attribute is used to include External JS code inside your HTML Document?

src
ext
script
link

Question No : 10
A proper scripting language is a __________

High level programming language
Assembly level programming language
Machine level programming language
Low level programming language

Question No : 11
What will be the output of the following Javascript code?

var txt1 = good;
var txt2 = day;
document.getElementById(demo).innerHTML = txt1 + txt2;

 

good day
goodday
error
undefined

Question No : 12
What will be the output of the following Javascript code?

<script>
var x = 5;
var y = 2;
var z = x % y;
document.getElementById("demo").innerHTML = z;
</script>


0
1
2
5

Question No : 13
What will be the output of the following Javascript code?

<script>
var x = 10;
x *= 5;
document.getElementById("demo").innerHTML = x;
</script>


5
10
50
Error

Question No : 14
What will be the output of the following Javascript code?

<script>
txt1 = “ one”;
txt1 += “two”;
document.getElementById("demo").innerHTML = txt1;
</script>


onetwo
one two
error
undefined