Fundamental Quiz about JavaScript:
Question: Why do JavaScript and Java have similar names?
(a) JavaScript is a stripped-down version of Java
(b) JavaScript’s syntax is loosely based on Java’s
(c) They both originated on the island of Java
(d) Both were invented by Java Toshomashi
Question: What does the <noscript> tag do?
(a) Enclose text to be displayed by non-JavaScript browsers.
(b) Prevents scripts on the page from executing.
(c) Describes certain low-budget movies.
(d) None of the above
Question: Scripting language are
(a) High Level Programming language
(b) Assembly Level programming language
(c) Machine level programming language
Question: JavaScript is _____ language.
(a) Application
(b) Programming
(c) Scripting
(d) None of These
Related: python quiz with answers
Question: JavaScript entities start with _______ and end with _________.
(a) Semicolon, colon
(b) Semicolon, Ampersand
(c) Ampersand, colon
(d) Ampersand, semicolon
Question: ______ tag is an extension to HTML that can enclose any number of JavaScript statements.
(a) <SCRIPT>
(b) <BODY>
(c) <HEAD>
(d) <TITLE>
Question: Which of the following best describes JavaScript?
(a) low-level programming language.
(b) a scripting language precompiled in the browser.
(c) a compiled scripting language.
(d) an object-oriented scripting language.
Question: JavaScript can be written –
(a) directly onto HTML pages
(b) directly into JS file and included in HTML
(c) None of these
(d) directly on the Server Script
Related: Powerpoint quiz questions with answers
Question: Which of the following attributes is used to include External JS code inside your HTML Document –
(a) link
(b) script
(c) ext
(d) src
Question: Which of the following events fires when the form element loses focus: <button>, <input>, <label>, <select>, <textarea>?
(a) onfocus
(b) onblur
(c) onclick
(d) ondblclick
Question: Which of the following attributes can hold the JavaScript version?
(a) LANGUAGE
(b) SCRIPT
(c) VERSION
(d) None of the above
Question: When a user views a page containing a JavaScript program, which machine actually executes the script?
(a) The user’s machine running a Web browser
(b) The Web server
(c) A central machine deep within Netscape’s corporate offices
(d) None of the above
Question: How to create a Date object in JavaScript?
(a) dateObjectName = new Date([parameters])
(b) dateObjectName.newDate([parameters])
(c) dateObjectName := new Date([parameters])
(d) dateObjectName Date([parameters])
Question: _____ JavaScript statements embedded in an HTML page can respond to user events such as mouse-clicks, form input, and page navigation.
(a) Client-side
(b) Server-side
(c) Local
(d) Native
Question: The syntax of a blur method in a button object is ________
(a) Blur()
(b) Blur(contrast)
(c) Blur(value)
(d) Blur(depth)
Question: What is the correct JavaScript syntax to write “Hello World”?
(a) System.out.println(“Hello World”)
(b) println (“Hello World”)
(c) document.write(“Hello World”)
(d) response.write(“Hello World”)
Related: Photoshop questions
Question: The syntax of capture events method for documents is ______________
(a) captureEvents()
(b) captureEvents(argseventType)
(c) captureEvents(eventType)
(d) captureEvents(eventVal)
Question: JavaScript is designed for the following purpose –
(a) To add interactivity to HTML Pages.
(b) To Execute Query Related to DB on Server
(c) To Perform Server Side Scripting Operation
(d) To Style HTML Pages
Question: Choose the client-side JavaScript object:
(a) Database
(b) Cursor
(c) Client
(d) FileUpLoad
Question: The syntax of close method for document object is ______
(a) Close(doC
(b) Close(object)
(c) Close(val)
(d) Close()
Related: microsoft excel exam questions
Question: In JavaScript, Window.prompt() method returns true or false value ?
(a) False
(b) True
Question: Which of the following methods can be used to indicate the LANGUAGE attribute?
(a) <LANGUAGE=”JavaScriptVersion”>
(b) <SCRIPT LANGUAGE=”JavaScriptVersion”>
(c) <SCRIPT LANGUAGE=”JavaScriptVersion”> JavaScript statements…</SCRIPT>
(d) <SCRIPT LANGUAGE=”JavaScriptVersion”!> JavaScript statements…</SCRIPT>
Question: <script language=”javascript”>
function x()
{
document.write(2+5+”8″);
}
</script>
(a) 258
(b) Error
(c) 7
(d) 78
Question: <script type=”text/javascript”>
x=4+”4″;
document.write(x);
</script>
Output——?
(a) 44
(b) 8
(c) 4
(d) Error output
Related: microsoft word quiz answers
Question: <script type=”text/javascript”>
var s = “9123456 or 80000?”;
var pattern = /\d{4}/;
var output = s.match(pattern);
document.write(output);
</script>
(a) 9123
(b) 91234
(c) 80000
(d) None of the above
Question: JavaScript Code is written inside a file having extension _______.
(a) .js
(b) .jsc
(c) .javascript
(d) .jvs
Question: What should appear at the very end of your JavaScript?
The <script LANGUAGE=”JavaScript”>tag
(a) The </script>
(b) The <script>
(c) The END statement
(d) None of the above
Question: JavaScript is ____ Side Scripting Language.
(a) Browser
(b) ISP
(c) None of these
(d) Server
Related: computer operating system quiz
Question: Inside which HTML element do we put JavaScript?
(a) <js>
(b) <scripting>
(c) <script>
(d) <javascript>
Question: Select all the correct options. State the correct place of JS Code inside HTML –
(a) Inside the Body
(b) Inside Head
(c) All of these
(d) Inside Single JavaScript File
Question: Which of the following can’t be done with client-side JavaScript?
(a) Validating a form
(b) Sending a form’s contents by email
(c) Storing the form’s contents to a database file on the server
(d) None of the above
Question: Inside which HTML element do we put JavaScript?
(a) <js>
(b) <scripting>
(c) <script>
(d) <javascript>
Related: information security questions and answers
Question: Why is JavaScript called a Lightweight Programming Language ?
(a) because we can add programming functionality inside JS
(b) because JS can provide programming functionality inside but up to a certain extent.
(c) because JS is available free of cost.
(d) because JS is client side scripting
Question: Which of the following are the capabilities of functions in JavaScript?
(a) Return a value
(b) Accept parameters and return a value
(c) Accept parameters
(d) None of the above
Question: What is the correct syntax for referring to an external script called ” abc.js”?
(a) <script href=” abc.js”>
(b) <script name=” abc.js”>
(c) <script src=” abc.js”>
(d) None of the above