- Trending Categories
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
Found 2417 Articles for HTML
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
112 Views
The HTML DOM Italic Object represents an element which displays text in italic.SyntaxFollowing is the syntax −Creating an elementvar italicObject = document.createElement(“I”)ExampleLet us see an example for Italic object element − Live Demo Italic Object form { width:70%; margin: 0 auto; text-align: center; } * { padding: 2px; margin:5px; } input[type="button"] { border-radius: 10px; } Italic Object Formatter: var divDisplay = document.getElementById("divDisplay"); var textSelect = document.getElementById("textSelect"); function convertItalic() { var italicObject = document.createElement("I"); var italicText = document.createTextNode(textSelect.value); italicObject.appendChild(italicText); divDisplay.appendChild(italicObject); } OutputThis will produce the following output −Before clicking ‘Check’ button −After clicking ‘Check’ button −
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
81 Views
The HTML DOM isSameNode() method returns a boolean value (true/false) if two nodes are same or not.Note − The isSameNode() method is deprecated so you should use ‘===’ operator instead.SyntaxFollowing is the syntax −Calling isSameNode()nodeOne.isSameNode(NodeTwo)ExampleLet us see an example for isSameNode() method − Live Demo isSameNode() form { width:70%; margin: 0 auto; text-align: center; } * { padding: 2px; margin:5px; } input[type="button"] { border-radius: 10px; } ul{ width: 30%; ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
50 Views
The HTML DOM isEqualNode() method returns a boolean value (true/false) if specified nodes are equal or not.SyntaxFollowing is the syntax −Calling isEqualNode()firstNode.isEqualNode(secondNode)NOTE − ‘firstNode’ and ‘secondNode’ are equal only if they have same type, attributes and attribute values. All childNodes if any should also be the same.ExampleLet us see an example for isEqualNode() method − Live Demo isEqualNode() body{ width: 90%; margin: 0 auto; } button{ border-radius:10px; display:block; margin:0 auto; } #authorJohn, #authorMaya{ border:1px solid ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
76 Views
The HTML DOM isDefaultNamespace() method returns a boolean value (true/false) if specified namespace is default or not.Note − An element node inherits the namespace of its parent node, therefore, all elements in an XHTML document has the namespaceURI "http://www.w3.org/1999/xhtml".SyntaxFollowing is the syntax −Calling isDefaultNamespace()document.documentElement.isDefaultNamespace("nameSpaceURI")ExampleLet us see an example for isDefaultNamespace() method − Live Demo isDefaultNamespace() form { width:70%; margin: 0 auto; text-align: center; } * { padding: 2px; margin:5px; } input[type="button"] { border-radius: 10px; } ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
66 Views
The HTML DOM isContentEditable property returns whether the content of an element can be modified or not.SyntaxFollowing is the syntax −Returning boolean value - true/falseHTMLElementObject.isContentEditableBoolean ValuesHere, “booleanValue” is returned −booleanValueDetailstrueIt defines that the content of HTMLElementObject is editable.falseIt defines that the content of HTMLElementObject is not editable.ExampleLet us see an example for isContentEditableproperty − Live Demo isContentEditable form { width:70%; margin: 0 auto; text-align: center; } * { padding: 2px; margin:5px; } input[type="button"] { border-radius: ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
102 Views
The HTML DOM insertBefore() method inserts a new node before an already existing child node.SyntaxFollowing is the syntax −Calling insertBefore() with parameters of positionString and textnode.insertBefore(newNode, existingNode)Here, parameters can be the following −ParametersparametersDescriptionnewNodeIt is the newly created child node which is to be appended at beginningexistingNodeIt is the already existing nodeExampleLet us see an example for InsertBefore() method − Live Demo insertBefore() form { width:70%; margin: 0 auto; text-align: center; } * { padding: 2px; margin:5px; } input[type="button"] ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
112 Views
The HTML DOM insertAdjacentText() method inserts text string at a specified position.SyntaxFollowing is the syntax −Calling insertAdjacentText() with parameters of positionString and textnode.insertAdjacentText(“positionString”, text)Position StringsHere, “positionString” can be the following −positionStringDescriptionafterbeginIt inserts text after the beginning of node elementafterendIt inserts text after the node elementbeforebeginIt inserts text before the node elementbeforeendIt inserts text before the end of node elementExampleLet us see an example for InsertAdjacentText() method − Live Demo insertAdjacentText() form { width:70%; margin: 0 auto; text-align: center; } * { padding: 2px; ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
204 Views
The HTML DOM insertAdjacentHTML() method inserts text string as HTML at a specified position.SyntaxFollowing is the syntax −Calling insertAdjacentHTML() with parameters of positionString and HTML codenode.insertAdjacentHTML(“positionString”, “htmlString”)Position StringsHere, “positionString” can be the following −positionStringDescriptionafterbeginIt inserts htmlString after the beginning of node elementafterendIt inserts htmlString after the node elementbeforebeginIt inserts htmlString before the node elementbeforeendIt inserts htmlString before the end of node elementHtml Stringsand, “htmlString” can be the following −positionStringnew span or This is a new paragraphor any other valid html codeExampleLet us see an example for InsertAdjacentHTML() method − Live Demo insertAdjacentHTML() form { ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
155 Views
The HTML DOM insertAdjacentElement() method inserts an element at a specified position.SyntaxFollowing is the syntax −Calling insertAdjacentElement() with parameters of positionString and elementnode.insertAdjacentElement(“positionString”, element)Position StringsHere, “positionString” can be the following −positionStringDescriptionafterbeginIt inserts element after the beginning of node elementafterendIt inserts element after the node elementbeforebeginIt inserts element before the node elementbeforeendIt inserts element before the end of node elementExampleLet us see an example for InsertAdjacentElement() method − Live Demo insertAdjacentElement() form { width:70%; margin: 0 auto; text-align: center; } * { padding: ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
63 Views
The HTML DOM ins dateTime property returns the date and time for when the text was inserted.SyntaxFollowing is the syntax −Returning string valueinsObject.dateTimeExampleLet us see an example for ins dateTime property − Live Demo ins dateTime form { width:70%; margin: 0 auto; text-align: center; } * { padding: 2px; margin:5px; } input[type="button"] { border-radius: 10px; } ins-dateTime Fact: Water cannot persist on moon's surface. Water ice found on ... Read More