JavaScript Interview Questions and Answers (294) - Page 13

How to evaluate "1"+2+3+4+5=? in JavaScript?

Consider the following Javascript code:-
<script language="javascript" type="text/javascript">

function Evaluate()
{
var i = "1";
var j = 2;
var k = 3;
var l = 4;
var m = 5;
alert(i + j + k + l + m);
}
</script>
<input type="button" id="calc" value="Click" onclick="Javascript:Evaluate();" />


Output:-
12345


Because "i" is string so all the variables considered as a string.
Which HTML Form Events does fire the moment that the element loses focus?

NOTE: This is objective type question, Please click question title for correct answer.
What is escape() function in Javascript?

escape() function is used to encode the string to convert it as portable string so that it can be sent across any network to any computer which supports ASCII characters.
This function encodes special characters,with the exception of @ * + - / . _

Syntax:
escape(string_expr);

Where string_expr is the string to be encoded .
Give an example of escape() function?

<script>

document.write(escape("Questions? Get from us!"));
</script>

Output:
Questions%3F%20Get%20from%20us%21

What does the <noscript> tag do?

NOTE: This is objective type question, Please click question title for correct answer.
Which object is the server-side JavaScript object?

NOTE: This is objective type question, Please click question title for correct answer.
Which of the following is not considered a JavaScript operator?

NOTE: This is objective type question, Please click question title for correct answer.
Which method evaluates a string of JavaScript code?

NOTE: This is objective type question, Please click question title for correct answer.
What is the The syntax of Eval in Javascript?

NOTE: This is objective type question, Please click question title for correct answer.
Using which statement we test for a specific condition?

NOTE: This is objective type question, Please click question title for correct answer.
Which of the following is the structure of an if statement?

NOTE: This is objective type question, Please click question title for correct answer.
Date object in JavaScript is created using which statement?

NOTE: This is objective type question, Please click question title for correct answer.
Which method of an Array object adds and/or removes elements from an array in Javascript?

NOTE: This is objective type question, Please click question title for correct answer.
Which of the following statement is used to set up the window to capture all Click events in Javascript?

NOTE: This is objective type question, Please click question title for correct answer.
What is the use of blur() Method in Javascript?

The blur() method is used to remove focus from a button.
Syntax:-
blur()


For Example:-
function LostFocus() 

{
document.form1.btn_save.blur();
}

What is the syntax of Close method for document object?

NOTE: This is objective type question, Please click question title for correct answer.
What does below statement say:- <strong>Vishal</strong>

NOTE: This is objective type question, Please click question title for correct answer.
Inside which HTML element do we put the JavaScript?

NOTE: This is objective type question, Please click question title for correct answer.
How do you write "Hello World" in an alert box?

NOTE: This is objective type question, Please click question title for correct answer.
Found this useful, bookmark this page to the blog or social networking websites. Page copy protected against web site content infringement by Copyscape

 Interview Questions and Answers Categories