Questions
Which of the following type of box is used to get input from the user?
- inputbox
- alert
- confirm
- prompt
- dialog
Which of the following is the correct syntax to access an element of the form object?
- document.forms.element
- document.forms[0].elements[0]
- document[0].forms.element
- document.forms.elements[0]
- document.forms[0].element
Which of the following event occurs when an image does not load properly?
- onabort
- onerror
- onunload
- onblur
- onimageunload
Which of the following is NOT a valid property of the 'plugin' object?
- name
- filename
- description
- mimetypes
- path
What will the output of the statement - Math.ceil(5.3)
- 5
- 6
- 4
- 0
- 5.3
Which property of the 'navigator' object is used to detect the name of the client browser?
- appCodeName
- appBrowserName
- appVersion
- appName
- userAgent
Which of the following is NOT a valid cookie field?
- expires
- domain
- path
- policy
- secure
Which property of the 'Location' object returns the complete URL?
- href
- hash
- hostname
- pathname
- host
Which of the following function returns the position of a specified character in a String?
- charAt
- indexOf
- valueOf
- substring
- match
Which of the following is NOT a feature of JavaScript?
- Less server interaction
- We can handle events in JavaScripts
- JavaScript supports multithreading.
- It makes a web page dynamic
- Supports drag and drop.
With reference to the RegExp object which meta character used to find a NON WORD CHARACTER?
- w
- v
- W
- n
- D
Which operator is used to find out if the specified property is in the specified object?
- in
- comma
- new
- this
- typeof
What will be the output of the above code?
var arr = new Array();
arr[0] = "Element 1";
arr[1] = "Element 2";
arr[2] = "Element 3";
arr[3] = "Element 4";
document.write(arr[0, 1, 2, 3]);
- Error
- Element 1
- Element 4
- Element 1, Element 2, Element 3, Element 4
- No output (blank screen)
If we want to write a statement that processes irrespective of whether the program has an exception or not, it should be written inside the ___ block.
- try
- else
- catch
- if
- finally
Which of the following functions is used to determine if the argument is a number?
- parseInt
- isNan
- isFinite
- eval
- isDigit
Which of the following properties returns the values of the pixels of the length of the width and height of the viewer's screen?
- screen.width and screen.height
- Resolution.width and Resolution.height
- screen.pixels.width and screen.pixels.height
- ViewerScreen.width and ViewerScreen.height
- None of the above.
Which of the following event occurs when an object loses its focus.
- onblur
- onfocuslost
- onunload
- onreset
- onchange
What will be the output of the above code?
fun3();
function fun1(i) {
function fun2(j) { return i * j; }
return fun2;
}
function fun3() {
r = fun1(5)(5);
alert(r);
}
- 5
- 15
- 10
- 25
- Compilation Error
Which of the following is NOT a JavaScript reserved word?
- continue
- label
- with
- export
- bool
Which of the following statements is false regarding the 'substring' function having the above syntax?
string.substring(index1,index2);
- If index1 equals index1, substring returns an empty string.
- If any of the argument is less than 0 it is considered as 0.
- If index2 is not specified, substring extracts characters till the end of the string.
- If either argument is greater than the length of the string, it is considered as the same value as stringName.length.
- It is compulsory to pass at least one argument while calling the substring() function.
Which of the following statements is FALSE regarding the null data type?
- The null data type has only one value.
- The typeOf operator shows null as boolean values.
- null is not same as 0
- null is a keyword
- Value of a variable can be set as null.
Which of the following tasks CAN NOT be performed by JavaScript?
- Detecting client browser information.
- Validating user input.
- Handling date and time.
- Mathematical calculations on client system.
- Access files on the client system.
Which of the following is NOT a restriction while using the "strict option" in JavaScript?
- Variables must be declared
- Parameter name can not be duplicated
- eval can not be used as an identifier.
- with statement
- The word string can not be used as an identifer
What will be the output of the above code snippet?
var str=This is a sample string;
var output=str.split(,);
document.write(output);
- Compilation Error
- This,is,a,sample,string
- This,is,a,sample,string,
- ,This,is,a,sample,string,
- T,h,i,s,i,s,a,s,a,m,p,l,e,s,t,r,i,n,g
Which of the following statements is FALSE regarding InnerHTML?
- The content of a webpage can be changed dynamically using InnerHTML.
- The id of an element can be referred by using getElement() method.
- InnerHTML is not a part of DOM.
- It was introduced by Microsoft.
- It is valid for both block and inline elements.