🧪 JavaScript MCQ Quiz Hub

JavaScript MCQ Questions And Answers

Choose a topic to test your knowledge and improve your JavaScript skills

1. Why so JavaScript and Java have similar name?




2. When a user views a page containing a JavaScript program, which machine actually executes the script?




3. _____ JavaScript is also called client-side JavaScript.




4. _______ JavaScript is also called server-side JavaScript.




5. What are variables used for in JavaScript Programs?




6. __ JavaScript statements embedded in an HTML page can respond to user events such as mouse-clicks, form input, and page navigation.




7. What should appear at the very end of your JavaScript? The <script LANGUAGE="JavaScript">tag




8. Which of the following can't be done with client-side JavaScript?




9. Which of the following are capabilities of functions in JavaScript?




10. Which of the following is not a valid JavaScript variable name?




11. _____ tag is an extension to HTML that can enclose any number of JavaScript statements.




12. How does JavaScript store dates in a date object?




13. Which of the following attribute can hold the JavaScript version?




14. What is the correct JavaScript syntax to write "Hello World"?




15. Which of the following way can be used to indicate the LANGUAGE attribute?




16. Inside which HTML element do we put the JavaScript?




17. What is the correct syntax for referring to an external script called " abc.js"?




18. Which types of image maps can be used with JavaScript?




19. Which of the following navigator object properties is the same in both Netscape and IE?




20. Which is the correct way to write a JavaScript array?




21. What does the <noscript> tag do?




22. If para1 is the DOM object for a paragraph, what is the correct syntax to change the text within the paragraph?




23. JavaScript entities start with _______ and end with _________.




24. Which of the following best describes JavaScript?




25. Choose the server-side JavaScript object?




26. Choose the client-side JavaScript object?




27. Which of the following is not considered a JavaScript operator?




28. _____method evaluates a string of JavaScript code in the context of the specified object.




29. Which of the following event fires when the form element loses the focus: <button>, <input>, <label>, <select>, <textarea>?




30. The syntax of Eval is _______________




31. JavaScript is interpreted by ________




32. Using _______ statement is how you test for a specific condition.




33. Which of the following is the structure of an if statement?




34. How to create a Date object in JavaScript?




35. The _______ method of an Array object adds and/or removes elements from an array.




36. To set up the window to capture all Click events, we use which of the following statement?




37. Which tag(s) can handle mouse events in Netscape?




38. ___________ is the tainted property of a window object.




39. To enable data tainting, the end user sets the _________ environment variable.




40. In JavaScript, _________ is an object of the target language data type that encloses an object of the source language.




41. When a JavaScript object is sent to Java, the runtime engine creates a Java wrapper of type ___________




42. _____ class provides an interface for invoking JavaScript methods and examining JavaScript properties.




43. _______ is a wrapped Java array, accessed from within JavaScript code.




44. A ________ object is a reference to one of the classes in a Java package, such as netscape.javascript .




45. The JavaScript exception is available to the Java code as an instance of __________




46. To automatically open the console when a JavaScript error occurs which of the following is added to prefs.js?




47. To open a dialog box each time an error occurs, which of the following is added to prefs.js?




48. The syntax of a blur method in a button object is ______________




49. The syntax of capture events method for document object is ______________




50. The syntax of close method for document object is _____________