Fundamental Quiz about JavaScript:
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
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
Scripting language are
(a) High Level Programming language
(b) Assembly Level programming language
(c) Machine level programming language
JavaScript is _____ language.
(a) Application
(b) Programming
(c) Scripting
(d) None of These
Related: python quiz with answers
JavaScript entities start with _______ and end with _________.
(a) Semicolon, colon
(b) Semicolon, Ampersand
(c) Ampersand, colon
(d) Ampersand, semicolon
______ tag is an extension to HTML that can enclose any number of JavaScript statements.
(a) <SCRIPT>
(b) <BODY>
(c) <HEAD>
(d) <TITLE>
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.
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
Which of the following attributes is used to include External JS code inside your HTML Document –
(a) link
(b) script
(c) ext
(d) src
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
Which of the following attributes can hold the JavaScript version?
(a) LANGUAGE
(b) SCRIPT
(c) VERSION
(d) None of the above
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
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])
_____ 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
The syntax of a blur method in a button object is ________
(a) Blur()
(b) Blur(contrast)
(c) Blur(value)
(d) Blur(depth)
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
The syntax of capture events method for documents is ______________
(a) captureEvents()
(b) captureEvents(argseventType)
(c) captureEvents(eventType)
(d) captureEvents(eventVal)
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
Choose the client-side JavaScript object:
(a) Database
(b) Cursor
(c) Client
(d) FileUpLoad
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
In JavaScript, Window.prompt() method returns true or false value ?
(a) False
(b) True
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>
<script language=”javascript”>
function x()
{
document.write(2+5+”8″);
}
</script>
(a) 258
(b) Error
(c) 7
(d) 78
<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
<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
JavaScript Code is written inside a file having extension _______.
(a) .js
(b) .jsc
(c) .javascript
(d) .jvs
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
JavaScript is ____ Side Scripting Language.
(a) Browser
(b) ISP
(c) None of these
(d) Server
Related: computer operating system quiz
Inside which HTML element do we put JavaScript?
(a) <js>
(b) <scripting>
(c) <script>
(d) <javascript>
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
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
Inside which HTML element do we put JavaScript?
(a) <js>
(b) <scripting>
(c) <script>
(d) <javascript>
Related: information security questions and answers
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
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
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