HTML DOM

  Home  Computer Programming  HTML DOM


“HTML DOM guideline for job interview preparation. Explore list of HTML DOM frequently asked questions(FAQs) asked in number of HTML DOM interviews. Post your comments as your suggestions, questions and answers on any HTML DOM Interview Question or answer. Ask HTML DOM Question, your question will be answered by our fellow friends.”



10 HTML DOM Questions And Answers

1⟩ 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.

 213 views

2⟩ 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.

 197 views

4⟩ 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.

 202 views

5⟩ 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>

 189 views

6⟩ 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.

 209 views

7⟩ 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.

 196 views

8⟩ What is XML family?

Display : XHTML, XSLT, XSL

Modeling : DTD, XML Schema

Manipulating : DOM, SAX

Querying : Xlink, XQL, Xpath

 214 views

9⟩ 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.

 189 views

10⟩ 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

 203 views