1. src attribute of the

1.  What is JavaScript?

JavaScript is a Scripting language which is a light-weight programming language and is interpreted by the browser when a web page is loaded. It was created by Brendan Eich at Netscape. JavaScript is initially termed as LiveScript later renamed to JavaScript. JavaScript is Object Oriented Scripting Language and it is different from Java because Java is Object Oriented Programming Language. In the scripting language, the compilation step is not needed as it is interpreted.

We Will Write a Custom Essay Specifically
For You For Only $13.90/page!


order now

2. How to use External JavaScript file?

JavaScript can be placed in external files also. External JavaScript is embedded in the HTML page which increases the speed of web page and provides code reusability as single JavaScript file can be used in many HTML pages. The external file is to be saved with a .js extension. To use an external JavaScript point to the .js  file in src attribute of the tags.                                                                                                                                                 Advantages of External JavaScript                                                                                                             1. The main advantage is code reusability as a single script is used in several HTML pages.                                        2. It also increases the speed of the web page as all JavaScript files are embedded into a single page.

3. What is BOM?

To run a web page different web browsers are required which are divided into different parts called Objects. These objects collectively known as Browser Object Model( BOM). To interact with the browsers browser object model is used. In this, the different objects used are Window, Navigator, history, and Screen where Window is the default browser object.

4. What is DOM? What is the use of document objects?

A Document Object Model represents complete HTML document with which dynamic content can be added to the web page. As it is window object it can be accessed by using window.document or simply document.                                                                                                  Use: With the help of DOM,                                                                                                             1. JavaScript can change or add or remove the HTML elements and attributes in a page.                          2. It can react to the existing HTML events in the page.                                                                                                                                                        3. It can also create new events on the page

5. What is the use of Window Object?

Window Object is a browser object. It represents browser's window and is supported by all the browsers. The default object of BOM is Window. All the global JavaScript variables, functions, objects automatically become the member of a Window object. The Window object is the top-level object in client-side and so it contains other objects like history, document etc in it. It has different properties and methods to an perform action in the browser.