The HTML DOM Column object is associated with the HTML element. The Column object is used to get or set the properties of element. The tag is used only inside a element.PropertiesFollowing is the property for column object −PropertyDescriptionSpanTo set or return the span attribute value of a column.SyntaxFollowing is the syntax for −Creating a Column object −var a = document.createElement("COL");ExampleLet us see an example for the column object −Live Demo table, th, td { border: 1px solid blue; } #Col1{ background-color:pink; } ... Read More
The HTML DOM ColumnGroup object is associated with the HTML element. The element is used to apply CSS styles to a specific number of columns or all columns. This gives us a greater control on the columns that are present in a table.PropertiesFollowing is the ColumnGroup property −PropertyDescriptionspanSets or returns the value of the span attribute of a column groupSyntaxFollowing is the syntax for −Creating a ColumnGroup object −var x = document.createElement("COLGROUP");ExampleLet us see an example for the ColumnGroup object −Live Demo table, th, td { border: 1px solid black; ... Read More
The HTML DOM console.info() method is used to write an informational message to the console. This method is useful for debugging and testing purposes. Some browsers e.g: firefox, chrome display a small i icon in blue color for the statements printed using this method.SyntaxFollowing is the syntax for the HTML DOM console.info() method −console.info( message )Here, the message is a required parameter and can be of type string or object. It is displayed in the console.ExampleLet us see an example for the HTML DOM console.info() method −Live Demo console.info() Method Press F12 key to view the message in ... Read More
The HTML DOM Datalist object is associated with the HTML5 element.SyntaxFollowing is the syntax −To create Datalist object −var p = document.createElement("DATALIST");To access Datalist object −var p = document.getElementById("demoDatalist");ExampleLet us look at an example for the HTML DOM Datalist object −Live Demo DATALIST button{ margin-top:90px; } Datalist object example Click the below button to create a datalist element with options CREATE function createData() { var i = document.createElement("INPUT"); i.setAttribute("list", "fruits"); document.getElementById("FORM1").appendChild(i); var ... Read More
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
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
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
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
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
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
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP