Web Programming (3160713) MCQs

MCQs of Client Side Scripting using JavaScript

Showing 11 to 20 out of 41 Questions
11.
JavaScript entities start with _______ and end with _________.
(a) Semicolon, colon
(b) Semicolon, Ampersand
(c) Ampersand, colon
(d) Ampersand, semicolon
Answer:

Option (d)

12.
Which of the following best describes JavaScript?
(a) a low-level programming language.
(b) a scripting language precompiled in the browser.
(c) a compiled scripting language.
(d) an object-oriented scripting language.
Answer:

Option (d)

13.
Which of the following event fires when the form element loses the focus:
(a) onfocus
(b) onblur
(c) onclick
(d) ondblclick
Answer:

Option (b)

14.
How to create a Date object in JavaScript?
(a) dateObjectName = new Date([parameters])
(b) dateObjectName.new Date([parameters])
(c) dateObjectName := new Date([parameters])
(d) dateObjectName Date([parameters])
Answer:

Option (a)

15.
Which tag(s) can handle mouse events in Browser?
(a) <IMG>
(b) <A>
(c) <BR>
(d) None of the above
Answer:

Option (b)

16.
JavaScript is can be written _____________
(a) directly on server script
(b) directly into js file and include into HTML
(c) directly on CSS file
(d) None of Above
Answer:

Option (b)

17.
<script type="text/javascript">
x=4+"4";
document.write(x);
</script>


output will be?

(a)

44

(b)

8

(c)

4

(d)

Error output

Answer:

Option (a)

18.
<script language="javascript"> function x() { document.write(2+5+"8"); } </script>

 output?

(a)

258

(b)

Error

(c)

7

(d)

78

Answer:

Option (d)

19.
<script type="text/javascript">

var s = "+999A999";
var pattern = new RegExp("^[a-zA-Z0-9]");
document.write("Hello ");
if(pattern.test(s))
{
document.write("Friend");
}
else
{
document.write("Classmate");
}
</script>

Output ??

(a)

Hello

(b)

Hello Friend

(c)

Hello Classmate

(d)

None of above

Answer:

Option (c)

20.
The external JavaScript file must contain the <script> tag.
(a) True
(b) False
Answer:

Option (b)

Showing 11 to 20 out of 41 Questions