1. Explain How to change HTML Attribute using HTML DOM?

example to change HTML Attribute by using HTML DOM.
Example:
<html>
<body>
<img id="image" src="oldimage.gif">
<script type="text/javascript">
document.getElementById("image").src="newimage.jpg";
</script>
</body>
</html>
In the above example we load an image on HTML document by using id="image".Using DOM we get the element with id="image".JavaScript that we used in example to changes the src attribute from oldimage.gif to newimage.jpg

2. Explain the syntax of UI object identifier used by DOM extension?

The DOM browser extension uses the following syntax for web UI objects:
Browser.BrowserChild(page_titile).html_class(object_tag)
1. page_title is the title of the web page, defined by the HTML TITLE tag.
2. object_tag is the label of the HTML element. How a HTML element is labeled depending on the type of HTML element.

3. Explain DOM and how does it relate to XML?

The Document Object Model (DOM) is an interface
specification maintained by the W3C DOM Workgroup that
defines an application independent mechanism to access,
parse, or update XML data. In simple terms it is a
hierarchical model that allows developers to manipulate XML
documents easily Any developer that has worked extensively
with XML should be able to discuss the concept and use of
DOM objects freely. Additionally, it is not unreasonable to
expect advanced candidates to thoroughly understand its
internal workings and be able to explain how DOM differs
from an event-based interface like SAX.

4. What is difference between DOM and SAX? What would we use if an option is given?

DOM parses an XML document and returns an instance of org.w3c.dom.Document. This document object's tree must then
be "walked" in order to process the different elements. DOM parses the ENTIRE Document into memory, and then makes it
available to you. The size of the Document you can parse is limited to the memory available.

5. Explain multi-tagging?

Multi-tagging is a technique used by the DOM browser extension to identify a web page UI object. Whenever possible, DOM extension inserts more than one tag into the object identifier in following format:
Browser.BrowserChild(page_title).html_class(caption_tag|window_tag)
1. Caption_tag is the caption of the HTML element.
2. #index_tag is the index of this HTML element, counting from the beginning of this page of the same class of HTML elements.
3. window_tag is the window identifier.

6. What is the DOM?

The DOM is a W3C (World Wide Web Consortium) standard.

The DOM defines a standard for accessing documents like HTML and XML:

"The W3C Document Object Model (DOM) is a platform and language-neutral interface that allows programs and scripts to dynamically access and update the content, structure, and style of a document."

The DOM is separated into 3 different parts / levels:

* Core DOM - standard model for any structured document
* XML DOM - standard model for XML documents
* HTML DOM - standard model for HTML documents

The DOM defines the objects and properties of all document elements, and the methods (interface) to access them.

7. Explain How DHTML work with JavaScript?

Using JavaScript we can made dynamic HTML content.
We can use document.write() to show dynamic content on your web page.Below I have given you HTML page which made dynamic after using JavaScript.This example will show current date.
Example:
<html>
<body>
<script type="text/javascript">
document.write(Date());
</script>
</body>
</html>

8. What is HTML DOM?

The HTML DOM is:

* A standard object model for HTML
* A standard programming interface for HTML
* Platform- and language-independent
* A W3C standard

The HTML DOM defines the objects and properties of all HTML elements, and the methods (interface) to access them.

9. What is Javascript and how does it work with the DOM?

JavaScript is just one of many programming languages with DOM support. What makes the combination of JavaScript and the DOM so exciting is the environment where they are used. Whereas most programming languages do all their work on the server side, putting together pages to be sent to the browser, JavaScript runs in the browser.

10. What is XML family?

Display : XHTML, XSLT, XSL
Modeling : DTD, XML Schema
Manipulating : DOM, SAX
Querying : Xlink, XQL, Xpath

Download Interview PDF