- 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)
188 Views
The HTML DOM DragEvent is a type of event that gets executed whenever the selected text is being dragged and dropped. This event was introduced in HTML5.PropertiesFollowing is the property for the HTML DOM DragEvent −PropertyDescriptiondataTransferTo return the data that is being dragged or dropped by the user.SyntaxFollowing is the syntax for DragEvent −Object.DragEventType= function_name;Here, function_name is the function that we want to execute on the event being executed.EventsFollowing are the event types belonging to the DragEvent object −EventDescriptionondragOccurs when an element is being dragged.ondragendOccurs when the element has been finished dragging by the user.ondragenterOccurs when the element enters the ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
92 Views
The HTML DOM domain property is used for getting the domain name of the server on which the document is being currently executing. It returns domain name in the form of string and the value can be null if the domain is not identified.SyntaxFollowing is the syntax for domain property −document.domainExampleLet us look at an example for the HTML DOM domain property − domain property example Get the domain name property value by clicking the below button Get domain function getDomain() { var doc = document.domain; document.getElementById("Sample").innerHTML ="The ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
67 Views
The HTML DOM documentElement property is used for returning the document element. The return type is of type Element Object. The document element is the root element of the document which in case of an HTML document will be the element. It is a read-only property.SyntaxFollowing is the syntax for documentElement property −document.documentElementExampleLet us look at an example of the documentElement property −Live Demo documentElement property example Get the document element name by clicking the below button GET NAME function getDocument() { var dName = document.documentElement.nodeName; document.getElementById("Sample").innerHTML = ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
124 Views
The HTML DOM doctype property returns the DTD (Document Type Declaration) that are associated with the current HTML document. It is a read-only property. It returns the doctype name as the DocumentType object. It can return null if no DTD is specified for the given document.SyntaxFollowing is the syntax for doctype property −document.doctypeExampleLet us look at an example for the doctype property −Live Demo doctype property example GET DOCTYPE function getDoctype() { var doc = document.doctype.name; document.getElementById("Sample").innerHTML ="The doctype for this HTML document is: "+doc; } ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
186 Views
The HTML DOM dl object is associated with the HTML element. The element is for creating the description list. Using the dl object we can dynamically create and acess the element using JavaScript.SyntaxFollowing is the syntax for −Creating a description list −var p = document.createElement("DL");ExampleLet us look at an example for the dl object −Live Demo Div object example Create a div by clicking the below button CREATE function createDiv() { var Desc = document.createElement("DL"); var DesT = document.createElement("DT"); var tn= document.createTextNode("Mango"); ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
441 Views
The HTML DOM div object is associated with the HTML element. Div is a general purpose block level element that allows us to group elements together to either apply style to them or to manipulate a group of HTML elements under a single tag name or id.PropertiesFollowing is the property for div object −PropertyDescriptionAlignTo set or return the align attribute value of the element. This property is not supported in HTML5 use css instead for aligning.SyntaxFollowing is the syntax for −Creating a div object −var p = document.createElement("DIV");ExampleLet us look at an example for the HTML DOM div ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
104 Views
The HTML DOM dir property is used for changing an element’s text direction from default left to right to right to left or auto. The dir property is used for setting and returning the dir attribute value of an element. The returned dir attribute value is of type string.SyntaxFollowing is the syntax for −Setting the dir property −HTMLElementObject.dir = "ltr|rtl|auto"Here, ltr=left to right text direction and it is the default text direction., rtl=right to left text direction, auto=text direction is based on content here and is usually figured by the web browser.ExampleLet us look at an example for the HTML ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
337 Views
The HTML DOM Dialog object is associated with the HTML5 element. It is used for creating popups, modals, etc on the web page. To view the dialog box and let the user interact with it the open attribute value should be set.PropertiesFollowing are the properties for the Dialog object −PropertyDescriptionopenTo set or return if the dialog should be opened or not.returnValueTo set or return the return value of the dialog.MethodsFollowing are the methods for the Dialog object −MethodDescriptionclose()To close the dialog.show()To show the dialog.showModal()To make the top most dialog box and display it.SyntaxFollowing is the syntax for −Creating a ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
84 Views
The HTML DOM DD object is associated with the HTML element present inside the Definition list denoted by element in the HTML document.SyntaxFollowing is the syntax for −Creating a DD object −var p = document.createElement("DD");ExampleLet us look at an example for the HTML DOM DD object −Live Demo dd object example Click the button below to create a dd element with some text in it CREATE Mango function create_dd() { var d = document.createElement("DD"); var txt = document.createTextNode("Mango is called the king of fruits."); ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
332 Views
The HTML DOM Datalist options collection is used for setting or returning the option value collection that are present inside the HTML element. The elements appear in the same order as they are in the document.PropertiesFollowing is the property for the Datalist options Collection −PropertyDescriptionlengthTo return the number of elements in the collection.It is a read-only property.MethodsFollowing are the methods for the Datalist options collection −MethodDescription[index]To return the element from the collection present at the specified index.Indexing starts from 0 and null is returned if the index number is out of range.item(index)To return the element from ... Read More