What is the purpose of HTML DOM Node Tree?
- HTML DOM view the HTML document with a tree structure format and it consists of root node and child nodes.
- The node-tree is being accessed using the tree formation and the structure in which the elements get created.
- The contents that are used being modified or removed using the new elements and it can be created within the limitations.
- The structure consists of a document that is the root and within it Root element <html> from where the tree starts.
- It consists of sub-elements like <head> and <body> and other text and attributes written in the HTML format.
How does the relationship exist between the node, child and siblings in node-tree?
- Node tree consists of root node, child and siblings with a defined relationship with each other.
- The relationship is described as such it allows the children on the same level to be called as siblings.
- The root node is the top most nodes and through this node the accessing will be done and the elements will be communicated.
- Every node in the tree will have exactly one parent node and root doesn't have any parent in this.
- A node at lower down the order can include many other nodes and they will be called as children of parent nodes.
Explain through program the relationship that exists between the root and other nodes present in node-tree?
- The code that shows the relationship is as follows:
<html>
<head>
<title>DOM </title>
</head>
<body>
<h1>DOM </h1>
<p>Hello world!</p>
</body>
</html>
- <html> is the top order node and can be termed as parent node or root node for more simplification.
- Parent node is used to have the child nodes under them so the <html> consists of <head> and <body> as the child node.
- <html> consists of two child nodes and <head> or other tags consists of other child nodes like that.
- The <h1> element or <head> element or <title> element is being used for the child node and it allows the creation of more sub-nodes.
What is the main function of DOM?
- The DOM is known as Document object model and it allows the accessing of the documents like HTML and XML.
- It also provides a way to update the content, structure and style of the document and a way to represent it in any language.
- It allows a platform to be language neutral and provide an interface that allows the dynamic usage of the scripts and programs to access the content.
- It is used with the language and used to create the objects that can be used as a model to allow the interface to be developed with ease.
What are the levels involved in DOM?
- DOM is known as document object model is divided into three different parts or levels:
- DOM is used to define the object with its properties that is having all the document elements and the methods allowing access to them.
- Core DOM is used for the standard model for all the structures and the structured documents.
- XML DOM is used as a standard model for the XML documents that can be different according to the different requirements.
- HTML DOM is used to have a standard model used for the HTML documents having the properties and functions.
What is the use or function of XML DOM?
- The XML DOM is used to define the standard model of the DOM structure and it defines all the properties of the XML elements or the methods for accessing it.
- XML DOM is used to create the instance of the XML parser by using the standard interfaces like COM.
- It consists of the inbuilt libraries and implementation code that is used to work with the document written in XML.
- It uses the command CreateObject method to be used with the XML DOM that allows the creation of the Parser object.
- The command that can be used in XML DOM is as follows:
Set objParser = CreateObject( "Microsoft.XMLDOM" )
What is the use of DOM in W3C standards?
- HTML DOM is used to add, remove, and change the elements of HTML by using the HTML DOM.
- DOM considers the entire element in an HTML document as a node and it treats all of them using the same standards.
- The document is being given in the document node and all the elements of the HTML are present in the element node.
- The text used in the HTML elements is for the text nodes and allows the properties to be used for further use.
- HTML usually consists of the attribute and it is stored in the attribute node that allows easy modification of the properties.
Write a program that shows the use of DOM?
- The root node is always written in HTML code <html> and the document nodes also mentioned in this node.
- <html> consists of mostly two child nodes in the form of <head> and <body> and in <head> there is a sub-node that is present <title>.
- <body> tag contains the node of the other tags that are used for visual representation of the content and it always stored in the text nodes.
- The program that is used to represent the structure of the DOM:
<html>
<head>
<title>DOM hello</title>
</head>
<body>
<h1>DOM lession one</h1>
<p>Hello Dom world! </p>
</body>
</html>
What are the errors made while processing the DOM?
- DOM is used to display the element node in the form of text using the text node and it shows the error while processing it.
- The text element is stored in the text node and it is displayed like:
<title>DOM </title>, element node <title>
- The tag is used to hold the text node with the value "DOM" that is used within it.
- The value of the <title> tag is not the “DOM” but it allows the accessing of the text node using the HTML properties.
- innerHTML property is being used to make the searching possible and allow the use of node properties.
What is the programming interface used for DOM or HTML documents?
- Programming interface is important if the DOM consisting of the HTML documents and provide settings for the node objects.
- Nodes in the tree are allowed to access the programming interface and it is defined with the DOM properties and methods.
- The properties and methods are used in the node and they are referred for the use in the HTML DOM.
- The DOM property that exists in HTML:
x.innerHTML – this stores the text value of x used to display it on the x axis.
x.nodeName – this stores the node name of x on the x axis of the node.
x.nodeValue – this provides the value of x for the node that is being used.
What are the properties of NODE?
Basically, We use properties of node to define selective information of NODE interms of nodeName, nodeValue and nodeType.
HTML DOM told each node as object.
nodeName Property: Using node properties we can define name of a node.Keep in mind such things when you try to use nodeName property. nodeName property.
These are:
nodeName is read only.We an also told as nodeName of an element node and attribute node are identical as tag name and attribute name repectively.nodeName of an text node and document node is set as #text and #document repectively.
nodeValue Property : Using nodeValue property we can define the value of a perticular node. Keep in mind such things when you try to use nodeValue property.
We told as nodevalue of an attribute node as attribute value. For element nodes nodeValue is undefined. nodeValue is text itself for text nodes.
Example:
<html>
<body>
<p id="note">DOM preparation </p>
<div id="msg">
<p id="msg1">DOM Tutorial</p>
<p id="msg2">HTML DOM Tutorial</p>
<p id="msg3">Using <h1>HTML DOM</h1> we can define object and their properties of nodes in an HTML document. Also use methods which told us how to access those nodes.</p>
</div>
<script >
e=document.getElementById("note").firstChild;
txt=e.nodeValue;
</script>
</body>
</html>
Output:
txt = "DOM preparation"
nodeType Property : Using nodeType propety we returns the type of node.
I have given you some Element type with their NodeType.
Element type(NodeType)
Element(1)
Attribute(2)
Text(3)
Comment(8)
Document(9)
What are the properties and methods of HTML DOM?
Properties and methods are help us to define HTML DOM programming interface.
I given some properties of HTML DOM. Let, 'e' is an HTML element or node object.
e.innerHTML : It shows the inner text value of e.
e.childNodes: It shows the child node of e.
e.attributes: It shows the attribute nodes of e.
e.nodeName : It shows the name of e.
e.nodeValue : It shows the value of e.
e.parentNode: It shows the parent node of e.
I have given you some methods that we used in HTML DOM.
e.getElementById(id) : Using them we can get the element with a specified id in an HTML document.
e.getElementsByTagName(name) : Using them we can get all elements with a specified tag name in an HTML document.
e.appendChild(node) : Using them we can insert a child node to e or increase the no of child nodes of e.
e.removeChild(node) : Using them we can remove a child node from e in an HTML DOM.
What are the methods involved in HTML DOM?
- HTML DOM methods are used as a way to generate the result without much of the written code and it can be easily used.
- HTML DOM provides methods to simplify the tasks and the methods are as follows:
x.getElementById(id) – this allow the getting of the element that is associated with a specified id.
x.getElementsByTagName(name) – this gets all the elements using the tag name that is associated with it.
x.appendChild(node) – this inserts a child node to x and append the child node at the end of the tree.
x.removeChild(node) – this removes a child node from x and remove from the tree area also.
What are the properties of HTML DOM involved in the system?
- innerHTML property is the property that allows easy modification of the content of an element in HTML.
- It allows the returning or replacing of the content in HTML or the elements like <html> or <head> used by it.
- It provides a way to use the page source and allows the way to dynamically modify those pages without manual effort.
- The properties like id, class and other individual properties of an element is involved in writing the HTML code.
- The example of it is shown below by using the <p> element properties as:
<html>
<body>
<p id="intro">Hello World!</p>
<script >
txt=document.getElementById("intro").innerHTML;
document.write("<p>Hello world: " + txt + "</p>");
</script>
</body>
</html>
Write a program that uses Methods and properties of HTML DOM?
- HTML DOM uses getElementById method in the JavaScript form to access the element’s id and make changes accordingly.
- There are properties like childNodes and nodeValue used to get the content using an element.
<html>
<body>
<p id="intro">Hello World!</p>
<script >
txt=document.getElementById("intro").childNodes[0].nodeValue;
document.write("<p>The text from the intro paragraph: " + txt + "</p>");
</script>
</body>
</html>
- The use of innerHTML property being used by applying the learning method that is useful and easily understandable by the tree structure of DOM.
What are the different properties of Nodes?
- Node is used in HTML DOM as an object that points to the other element in the tree and gets generated by the root node.
- Nodes in an object form have some methods and properties that allow the accessing of the JavaScript to be used for modification.
The node properties include the following things :
- nodeName: is in the read only format and it is the parameter that acts like a tag name. It provides the information of attribute node and other nodes.
- nodeValue: is the way to specify the value of each individual node. The node value can be element wise or it can be text wise or other nodes value can be given.
- nodeType: provides a way to return the type of the node used and that is also in the read only format.
Write a program to change an HTML element?
- HTML DOM uses the JavaScript features, elements and properties to change the inner content of the HTML elements.
- The HTML elements are having the attributes that are used to change the element’s properties like color, shape, etc.
- The example that allows the change is as follows:
<html>
<body>
<script >
document.body.bgColor="green";
</script>
</body>
</html>
Write a program to change the HTML element using events?
- Events are used to get generated when an action on a particular object takes place, this way some values gets changed or manipulated within a region.
- Event handlers are used to handle the events and execute the code using which the event is occurring.
- Events are usually being generated by the browser, when an event on some object takes place like user clicks an element.
- The example is shown below that is used to change the HTML element values:
<html>
<body>
<input onclick="document.body.bgColor='green';"
value="Change background color" />
</body>
</html>
Generally, Events are nothing other than actions. Using JavaScript we can noticed or triggered events.
Example: When you use click on button than an event occur and function associated with button execute.We placed events within HTML tags. I have given you some events. Click through mouse, Click on advertisement in web page, When you select an input box in a HTML form, When you submit an HTML form.
Generally, Events are nothing other than actions. Using JavaScript we can noticed or triggered events.
Example: When you use click on button than an event occur and function associated with button execute.We placed events within HTML tags. I have given you some events. Click through mouse, Click on advertisement in web page, When you select an input box in a HTML form, When you submit an HTML form.
What are the functionalities performed by onload() and onUpload()?
- onload() and onUpload() are two functions that gets activated or the event gets triggered when the user enters or leaves the page.
- onload() event is used to verify and check the user’s visit according to the browser’s type and it loads a version of the event.
- It provides the web page information that allows easy access to the website and consists of the information regarding the event that is triggered.
- Onload() and onUpload() events uses the cookies to hold down the values given by the users when it enters or leaves the page.
- This includes the example of a popup that opens up as many times the user is visiting the first page of the website.
onload and onUnload events are occurs when client enter on web page and leave the web page respectively.
Using onload event we can check the web browser type and web browser version which are used by client and load the web page according to the client browser.
One main work of onload and onUnload events are that using them we can setup cookies for when user enter on web page and leave that web page.
Example:
Using them we can perform task like we made popup(Like" enter your name) on web page when user enter on this web page and enter our name than his/her name will stored in cookie. And when it again open that web page than our another popup display like: "Hello Jscript, Welcomes You!".
What is XML family?
Display : XHTML, XSLT, XSL
Modeling : DTD, XML Schema
Manipulating : DOM, SAX
Querying : Xlink, XQL, Xpath
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.
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.
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.
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 labelled depending on the type of HTML element.
How to changed font and color of an text element?
I have given you example using them you can change font and text of an element by using a function.
Example:
<html>
<head>
<script >
function ChangeText()
{
document.getElementById("welcome").style.color="red";
document.getElementById("welcome").style.fontFamily="Times New Roman";
document.getElementById("welcome").style.fontSize="20";
}
</script>
</head>
<body>
<p id="welcome">R4R Welcomes You!</p>
<input onclick="ChangeText()"
value="When you click on button text font and color will change">
</body>
</html>
Using function how to change the background color?
I have given you example which shows you how to change background color by using function.
<html>
<head>
<script >
function ChangeBackground(){document.body.style.backgroundColor="pink";
}
</script>
</head>
<body><p id="welcome">R4R Welcomes You!</p>
<input onclick="ChangeBackground()"value="When you click on button than background color will changed.">
</body>
</html>
How to change the text of an element with a function?
I have given you example in which I changed the text of an element by using an function.
In this example text has been changed when you execute function.
Example:<html>
<head>
<script >
function ChangeText()
{
document.getElementById("welcome").innerHTML="R4R Welcomes You!";
}
</script>
</head>
<body>
<p id="welcome">Hello User!</p>
<input onclick="ChangeText()" value="When you click on button text will changed">
</body>
</html>
How to change the text of an element?
I have given you a scipt code using them you can change the text of an HTML element.Now, In example that I have shown below we change the text of the element <p>.
Example:
<html>
<body>
<p id="welcome">R4R Welcomes You!</p>
<script >
document.getElementById("welcome").innerHTML="A new message from R4R";
</script>
<p>R4R introduce a new service called VoiceBox using them you can chat with R4R.</p>
</body>
</html>
How to change the background color of an element?
I have given you a script code using them you can change the background color of elements of body.
<html>
<body>
<script >
document.body.bgColor="pink";
</script>
<p>Now, Your background color is pink.</p>
</body>
</html>
How to use onMouseOver and onMouseOut events?
When we want to made animated buttons than we use onMouseOver and onMouseOut events.
Example of an onMouseOver event.
Example that I have shown below When an onMouseOver event is detected than an alert box appears:
<a href="http://www.osingh.weebly.com" onmouseover="alert('An onMouseOver event');return false">
<img src=http://www.osingh.weebly.com/favicon.gif" width="50" height="40">
</a>
- HTML DOM view the HTML document with a tree structure format and it consists of root node and child nodes.
- The node-tree is being accessed using the tree formation and the structure in which the elements get created.
- The contents that are used being modified or removed using the new elements and it can be created within the limitations.
- The structure consists of a document that is the root and within it Root element <html> from where the tree starts.
- It consists of sub-elements like <head> and <body> and other text and attributes written in the HTML format.
How does the relationship exist between the node, child and siblings in node-tree?
- Node tree consists of root node, child and siblings with a defined relationship with each other.
- The relationship is described as such it allows the children on the same level to be called as siblings.
- The root node is the top most nodes and through this node the accessing will be done and the elements will be communicated.
- Every node in the tree will have exactly one parent node and root doesn't have any parent in this.
- A node at lower down the order can include many other nodes and they will be called as children of parent nodes.
Explain through program the relationship that exists between the root and other nodes present in node-tree?
- The code that shows the relationship is as follows:
<html>
<head>
<title>DOM </title>
</head>
<body>
<h1>DOM </h1>
<p>Hello world!</p>
</body>
</html>
- <html> is the top order node and can be termed as parent node or root node for more simplification.
- Parent node is used to have the child nodes under them so the <html> consists of <head> and <body> as the child node.
- <html> consists of two child nodes and <head> or other tags consists of other child nodes like that.
- The <h1> element or <head> element or <title> element is being used for the child node and it allows the creation of more sub-nodes.
What is the main function of DOM?
- The DOM is known as Document object model and it allows the accessing of the documents like HTML and XML.
- It also provides a way to update the content, structure and style of the document and a way to represent it in any language.
- It allows a platform to be language neutral and provide an interface that allows the dynamic usage of the scripts and programs to access the content.
- It is used with the language and used to create the objects that can be used as a model to allow the interface to be developed with ease.
What are the levels involved in DOM?
- DOM is known as document object model is divided into three different parts or levels:
- DOM is used to define the object with its properties that is having all the document elements and the methods allowing access to them.
- Core DOM is used for the standard model for all the structures and the structured documents.
- XML DOM is used as a standard model for the XML documents that can be different according to the different requirements.
- HTML DOM is used to have a standard model used for the HTML documents having the properties and functions.
What is the use or function of XML DOM?
- The XML DOM is used to define the standard model of the DOM structure and it defines all the properties of the XML elements or the methods for accessing it.
- XML DOM is used to create the instance of the XML parser by using the standard interfaces like COM.
- It consists of the inbuilt libraries and implementation code that is used to work with the document written in XML.
- It uses the command CreateObject method to be used with the XML DOM that allows the creation of the Parser object.
- The command that can be used in XML DOM is as follows:
Set objParser = CreateObject( "Microsoft.XMLDOM" )
What is the use of DOM in W3C standards?
- HTML DOM is used to add, remove, and change the elements of HTML by using the HTML DOM.
- DOM considers the entire element in an HTML document as a node and it treats all of them using the same standards.
- The document is being given in the document node and all the elements of the HTML are present in the element node.
- The text used in the HTML elements is for the text nodes and allows the properties to be used for further use.
- HTML usually consists of the attribute and it is stored in the attribute node that allows easy modification of the properties.
Write a program that shows the use of DOM?
- The root node is always written in HTML code <html> and the document nodes also mentioned in this node.
- <html> consists of mostly two child nodes in the form of <head> and <body> and in <head> there is a sub-node that is present <title>.
- <body> tag contains the node of the other tags that are used for visual representation of the content and it always stored in the text nodes.
- The program that is used to represent the structure of the DOM:
<html>
<head>
<title>DOM hello</title>
</head>
<body>
<h1>DOM lession one</h1>
<p>Hello Dom world! </p>
</body>
</html>
What are the errors made while processing the DOM?
- DOM is used to display the element node in the form of text using the text node and it shows the error while processing it.
- The text element is stored in the text node and it is displayed like:
<title>DOM </title>, element node <title>
- The tag is used to hold the text node with the value "DOM" that is used within it.
- The value of the <title> tag is not the “DOM” but it allows the accessing of the text node using the HTML properties.
- innerHTML property is being used to make the searching possible and allow the use of node properties.
What is the programming interface used for DOM or HTML documents?
- Programming interface is important if the DOM consisting of the HTML documents and provide settings for the node objects.
- Nodes in the tree are allowed to access the programming interface and it is defined with the DOM properties and methods.
- The properties and methods are used in the node and they are referred for the use in the HTML DOM.
- The DOM property that exists in HTML:
x.innerHTML – this stores the text value of x used to display it on the x axis.
x.nodeName – this stores the node name of x on the x axis of the node.
x.nodeValue – this provides the value of x for the node that is being used.
What are the properties of NODE?
Basically, We use properties of node to define selective information of NODE interms of nodeName, nodeValue and nodeType.
HTML DOM told each node as object.
nodeName Property: Using node properties we can define name of a node.Keep in mind such things when you try to use nodeName property. nodeName property.
These are:
nodeName is read only.We an also told as nodeName of an element node and attribute node are identical as tag name and attribute name repectively.nodeName of an text node and document node is set as #text and #document repectively.
nodeValue Property : Using nodeValue property we can define the value of a perticular node. Keep in mind such things when you try to use nodeValue property.
We told as nodevalue of an attribute node as attribute value. For element nodes nodeValue is undefined. nodeValue is text itself for text nodes.
Example:
<html>
<body>
<p id="note">DOM preparation </p>
<div id="msg">
<p id="msg1">DOM Tutorial</p>
<p id="msg2">HTML DOM Tutorial</p>
<p id="msg3">Using <h1>HTML DOM</h1> we can define object and their properties of nodes in an HTML document. Also use methods which told us how to access those nodes.</p>
</div>
<script >
e=document.getElementById("note").firstChild;
txt=e.nodeValue;
</script>
</body>
</html>
Output:
txt = "DOM preparation"
nodeType Property : Using nodeType propety we returns the type of node.
I have given you some Element type with their NodeType.
Element type(NodeType)
Element(1)
Attribute(2)
Text(3)
Comment(8)
Document(9)
What are the properties and methods of HTML DOM?
Properties and methods are help us to define HTML DOM programming interface.
I given some properties of HTML DOM. Let, 'e' is an HTML element or node object.
e.innerHTML : It shows the inner text value of e.
e.childNodes: It shows the child node of e.
e.attributes: It shows the attribute nodes of e.
e.nodeName : It shows the name of e.
e.nodeValue : It shows the value of e.
e.parentNode: It shows the parent node of e.
I have given you some methods that we used in HTML DOM.
e.getElementById(id) : Using them we can get the element with a specified id in an HTML document.
e.getElementsByTagName(name) : Using them we can get all elements with a specified tag name in an HTML document.
e.appendChild(node) : Using them we can insert a child node to e or increase the no of child nodes of e.
e.removeChild(node) : Using them we can remove a child node from e in an HTML DOM.
What are the methods involved in HTML DOM?
- HTML DOM methods are used as a way to generate the result without much of the written code and it can be easily used.
- HTML DOM provides methods to simplify the tasks and the methods are as follows:
x.getElementById(id) – this allow the getting of the element that is associated with a specified id.
x.getElementsByTagName(name) – this gets all the elements using the tag name that is associated with it.
x.appendChild(node) – this inserts a child node to x and append the child node at the end of the tree.
x.removeChild(node) – this removes a child node from x and remove from the tree area also.
What are the properties of HTML DOM involved in the system?
- innerHTML property is the property that allows easy modification of the content of an element in HTML.
- It allows the returning or replacing of the content in HTML or the elements like <html> or <head> used by it.
- It provides a way to use the page source and allows the way to dynamically modify those pages without manual effort.
- The properties like id, class and other individual properties of an element is involved in writing the HTML code.
- The example of it is shown below by using the <p> element properties as:
<html>
<body>
<p id="intro">Hello World!</p>
<script >
txt=document.getElementById("intro").innerHTML;
document.write("<p>Hello world: " + txt + "</p>");
</script>
</body>
</html>
Write a program that uses Methods and properties of HTML DOM?
- HTML DOM uses getElementById method in the JavaScript form to access the element’s id and make changes accordingly.
- There are properties like childNodes and nodeValue used to get the content using an element.
<html>
<body>
<p id="intro">Hello World!</p>
<script >
txt=document.getElementById("intro").childNodes[0].nodeValue;
document.write("<p>The text from the intro paragraph: " + txt + "</p>");
</script>
</body>
</html>
- The use of innerHTML property being used by applying the learning method that is useful and easily understandable by the tree structure of DOM.
What are the different properties of Nodes?
- Node is used in HTML DOM as an object that points to the other element in the tree and gets generated by the root node.
- Nodes in an object form have some methods and properties that allow the accessing of the JavaScript to be used for modification.
The node properties include the following things :
- nodeName: is in the read only format and it is the parameter that acts like a tag name. It provides the information of attribute node and other nodes.
- nodeValue: is the way to specify the value of each individual node. The node value can be element wise or it can be text wise or other nodes value can be given.
- nodeType: provides a way to return the type of the node used and that is also in the read only format.
Write a program to change an HTML element?
- HTML DOM uses the JavaScript features, elements and properties to change the inner content of the HTML elements.
- The HTML elements are having the attributes that are used to change the element’s properties like color, shape, etc.
- The example that allows the change is as follows:
<html>
<body>
<script >
document.body.bgColor="green";
</script>
</body>
</html>
Write a program to change the HTML element using events?
- Events are used to get generated when an action on a particular object takes place, this way some values gets changed or manipulated within a region.
- Event handlers are used to handle the events and execute the code using which the event is occurring.
- Events are usually being generated by the browser, when an event on some object takes place like user clicks an element.
- The example is shown below that is used to change the HTML element values:
<html>
<body>
<input onclick="document.body.bgColor='green';"
value="Change background color" />
</body>
</html>
Generally, Events are nothing other than actions. Using JavaScript we can noticed or triggered events.
Example: When you use click on button than an event occur and function associated with button execute.We placed events within HTML tags. I have given you some events. Click through mouse, Click on advertisement in web page, When you select an input box in a HTML form, When you submit an HTML form.
Generally, Events are nothing other than actions. Using JavaScript we can noticed or triggered events.
Example: When you use click on button than an event occur and function associated with button execute.We placed events within HTML tags. I have given you some events. Click through mouse, Click on advertisement in web page, When you select an input box in a HTML form, When you submit an HTML form.
What are the functionalities performed by onload() and onUpload()?
- onload() and onUpload() are two functions that gets activated or the event gets triggered when the user enters or leaves the page.
- onload() event is used to verify and check the user’s visit according to the browser’s type and it loads a version of the event.
- It provides the web page information that allows easy access to the website and consists of the information regarding the event that is triggered.
- Onload() and onUpload() events uses the cookies to hold down the values given by the users when it enters or leaves the page.
- This includes the example of a popup that opens up as many times the user is visiting the first page of the website.
onload and onUnload events are occurs when client enter on web page and leave the web page respectively.
Using onload event we can check the web browser type and web browser version which are used by client and load the web page according to the client browser.
One main work of onload and onUnload events are that using them we can setup cookies for when user enter on web page and leave that web page.
Example:
Using them we can perform task like we made popup(Like" enter your name) on web page when user enter on this web page and enter our name than his/her name will stored in cookie. And when it again open that web page than our another popup display like: "Hello Jscript, Welcomes You!".
What is XML family?
Display : XHTML, XSLT, XSL
Modeling : DTD, XML Schema
Manipulating : DOM, SAX
Querying : Xlink, XQL, Xpath
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.
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.
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.
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 labelled depending on the type of HTML element.
How to changed font and color of an text element?
I have given you example using them you can change font and text of an element by using a function.
Example:
<html>
<head>
<script >
function ChangeText()
{
document.getElementById("welcome").style.color="red";
document.getElementById("welcome").style.fontFamily="Times New Roman";
document.getElementById("welcome").style.fontSize="20";
}
</script>
</head>
<body>
<p id="welcome">R4R Welcomes You!</p>
<input onclick="ChangeText()"
value="When you click on button text font and color will change">
</body>
</html>
Using function how to change the background color?
I have given you example which shows you how to change background color by using function.
<html>
<head>
<script >
function ChangeBackground(){document.body.style.backgroundColor="pink";
}
</script>
</head>
<body><p id="welcome">R4R Welcomes You!</p>
<input onclick="ChangeBackground()"value="When you click on button than background color will changed.">
</body>
</html>
How to change the text of an element with a function?
I have given you example in which I changed the text of an element by using an function.
In this example text has been changed when you execute function.
Example:<html>
<head>
<script >
function ChangeText()
{
document.getElementById("welcome").innerHTML="R4R Welcomes You!";
}
</script>
</head>
<body>
<p id="welcome">Hello User!</p>
<input onclick="ChangeText()" value="When you click on button text will changed">
</body>
</html>
How to change the text of an element?
I have given you a scipt code using them you can change the text of an HTML element.Now, In example that I have shown below we change the text of the element <p>.
Example:
<html>
<body>
<p id="welcome">R4R Welcomes You!</p>
<script >
document.getElementById("welcome").innerHTML="A new message from R4R";
</script>
<p>R4R introduce a new service called VoiceBox using them you can chat with R4R.</p>
</body>
</html>
How to change the background color of an element?
I have given you a script code using them you can change the background color of elements of body.
<html>
<body>
<script >
document.body.bgColor="pink";
</script>
<p>Now, Your background color is pink.</p>
</body>
</html>
How to use onMouseOver and onMouseOut events?
When we want to made animated buttons than we use onMouseOver and onMouseOut events.
Example of an onMouseOver event.
Example that I have shown below When an onMouseOver event is detected than an alert box appears:
<a href="http://www.osingh.weebly.com" onmouseover="alert('An onMouseOver event');return false">
<img src=http://www.osingh.weebly.com/favicon.gif" width="50" height="40">
</a>