- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
The HTML DOM Object data property returns a string corresponding to the value of the attribute data.Following is the syntax −Returning string valueObjectElement.dataSet data property to a string valueObjectElement.data = URLStringLet us see an example of HTML DOM Object data property −Example Live Demo HTML DOM Object data form { width:70%; margin: 0 auto; text-align: center; } * { padding: 2px; margin:5px; } input[type="button"] { border-radius: 10px; } HTML-DOM-Object-data var divDisplay = document.getElementById("divDisplay"); var objSelect = document.getElementById("objSelect"); function getObjectData() { objSelect.data divDisplay.textContent = 'URL of above picture: '+objSelect.data; } OutputBefore clicking ‘Get URL’ button −After clicking ‘Get URL’ button −
The HTML DOM normalize() method removes empty Text Nodes, and joins adjacent Text Nodes from a specified node.Following is the syntax −Calling normalize()document.normalize()Let us see an example of normalize() method −Example Live Demo HTML DOM normalize() form { width:70%; margin: 0 auto; text-align: center; } * { padding: 2px; margin:5px; } input[type="button"] { border-radius: 10px; } HTML-DOM-normalize( ) ... Read More
The HTML DOM nodeValue property returns/sets a string corresponding to the value of the node.Following is the syntax −Returning string valueNode.nodeValueHere, the return value can be the following −Value as ‘null’ for document nodes & element nodesValue as ‘value’ of the attribute for attribute nodesValue as content for text nodes and comment nodesSet nodeValue to a string valueNode.nodeValue = stringNOTE: Whitespaces are considered as text nodes only.Let us see an example of HTML DOM nodeValue property −Example Live Demo HTML DOM nodeValue form { width:70%; margin: 0 auto; ... Read More
The HTML DOM nodeType property returns a number corresponding to the type of the node.Following is the syntax −Returning number valueNode.nodeTypeHere, the return value can be the following −Number ‘1’ for element nodesNumber ‘2’ for attribute nodesNumber ‘3’ for text nodesNumber ‘8’ for comment nodesNOTE: Whitespaces are considered as text nodes only.Let us see an example of HTML DOM nodeType property −Example Live Demo HTML DOM nodeType form { width:70%; margin: 0 auto; text-align: center; } * { padding: 2px; ... Read More
The HTML DOM nodeName property returns a string corresponding to the name of the node.Following is the syntax −Returning string valueNode.nodeNameHere, the return value can be the following −Tag name in uppercase for element nodesName of the attribute for attribute nodes‘#comment’ for comment nodes‘#document’ for comment nodes‘#text’ for text nodesNOTE: Whitespaces are considered as text nodes only.Let us see an example of HTML DOM nodeName property −Example Live Demo HTML DOM nodeName form { width:70%; margin: 0 auto; text-align: center; } * { ... Read More
The HTML DOM nextSibling property returns the element node which is immediately following specified element node.NOTE: This property does not ignore text and comment nodes.Following is the syntax −Returning nextSibling nodenodeList.nextSiblingLet us see an example of HTML DOM nextSibling property −Example Live Demo HTML DOM nextSibling form { width:70%; margin: 0 auto; text-align: center; } * { padding: 2px; margin:5px; } input[type="button"] { border-radius: 10px; } ul{ width: 30%; ... Read More
The HTML DOM nextElementSibling property returns the element node which is immediately following specified element node.NOTE: This property does ignore text and comment nodes.Following is the syntax −Returning nextElementSibling nodenodeList.nextElementSiblingLet us see an example of HTML DOM nextElementSibling property −Example Live Demo HTML DOM nextElementSibling form { width:70%; margin: 0 auto; text-align: center; } * { padding: 2px; margin:5px; } input[type="button"] { border-radius: 10px; } ul{ width: 30%; ... Read More
The HTML DOM Nav Object in HTML represents a element.Let us see an example of HTML DOM Nav object −Example Live Demo HTML DOM Nav * { padding: 2px; margin:5px; } form { width:70%; margin: 0 auto; text-align: center; } input[type="button"] { border-radius: 10px; } HTML-DOM-Nav ... Read More
The HTML DOM name property returns a string corresponding to the name of the attribute of an element.Following is the syntax −Returning string valueelementAttribute.nameLet us see an example of HTML DOM name property − Live Demo HTML DOM name * { padding: 2px; margin:5px; } form { width:70%; margin: 0 auto; text-align: center; } input[type="button"] { border-radius: 10px; } HTML-DOM-name ... Read More
The HTML DOM MouseEvent Object represents an event which incurs on interaction of mouse with the HTML document elements.Here, “MouseEvent” can have the following properties and methods −Property/MethodDescriptionaltKeyItreturns whether the "ALT" key on keyboard was pressedwhen the mouse event was triggeredbuttonItreturns a number corresponding to which mouse button was pressedwhen the mouse event was triggeredbuttonsItreturns which mouse buttons were pressed when the mouse event wastriggeredclientXItreturns the horizontal (x) coordinate of the mouse pointer, relative to the current window, when the mouse event was triggeredclientYItreturns the vertical (y) coordinate of the mouse pointer, relativeto the current window, when the mouse event ... Read More
To Continue Learning Please Login
Login with Google