Contents

What is the programming philosophy that argues that content and behaviour should as much as possible be kept separate?
a) Unobtrusive JavaScript
b) Obtrusive JavaScript
c) Inherited JavaScript
d) Modular JavaScript

a

Explanation: A programming philosophy known as unobtrusive JavaScript argues that content (HTML) and behavior (JavaScript code) should as much as possible be kept separate. According to this programming philosophy, JavaScript is best embedded in HTML documents using “script” elements with src attributes.


Which of the following communicates with server-side CGI scripts through HTML form submissions and can be written without the use of JavaScript?
a) Static Web Pages
b) Interactive Web Pages
c) Conditional Web Pages
d) All web pages

b

When does JavaScript code appear inline within an HTML file?
a) Between the “script” tag
b) Outside the “script” tag
c) Between or Outside the “script” tag
d) Between the header tag

a

Explanation: JavaScript code can appear inline within an HTML file between the “script” tags. Javascript can also be included from an external file specified by the src attribute of a “script” tag.


Which character in JavaScript code will be interpreted as XML markup?
a) !                                                         
b) >
c) &                                       
d) .

c

Which is the root element in a HTML document?
a) HTML                             
b) HEAD
c) SCRIPT                            
d) BODY

a

Explanation: The “html” tag is the root element of any HTML document regardless of it containing a JavaScript code or not. Body tag includes the main content that is shown on the website.


One of the main advantage of using src attribute is……….
a) It becomes self-cached
b) It makes the HTML file modular
c) It restricts manipulation in the HTML file
d) It simplifies the HTML files

d

Explanation: The main advantage of using the src attribute is that it simplifies your HTML files by allowing you to remove large blocks of JavaScript code from them. Hence separate files for css and javascript files are made to make the code modular and readable.