Found 2202 Articles for HTML

HTML DOM console.count() Method

AmitDiwan
Updated on 08-Aug-2019 11:41:38

531 Views

The HTML DOM console.count() method is used to write to console the number of times the console.count() method has been called. You can also supply an optional parameter label to this method. The label can help us in having separate counts of the console.count() method.SyntaxFollowing is the syntax for the console.count() method −console.count( [label] );Here, label is an optional parameter of type string that outputs how many times it has been called with that specified label.ExampleLet us see an example of the console.count() method − console.count() method Press F12 to view the message in the console view. COUNT ... Read More

HTML DOM console.clear() Method

AmitDiwan
Updated on 08-Aug-2019 11:36:22

741 Views

The HTML DOM console.clear() method is used to clear the console. The console.clear() method will also write “Console was cleared” message in the console and clears all the previous console content. This method is fully supported by all the browsers.SyntaxFollowing is the syntax for console.clear() method −console.clear()ExampleLet us see an example for the HTML DOM console.clear() method − JavaScript console.clear() Method Press F12 on the keyboard to see the message on your console console.log("TEXT has been printed on the console!"); Click the below button to clear the console CLEAR    function clearConsole() {       console.clear(); ... Read More

HTML DOM console.assert() Method

AmitDiwan
Updated on 07-Aug-2019 14:26:18

131 Views

The HTML DOM console.assert() method is used to write a message to the console only if the first expression supplied to it is false. These messages are intended for user to see. The expression as well as the displaying message are sent as first and second parameters to the console.assert() method respectively.SyntaxFollowing is the syntax for console.assert() method −console.assert(assertion, msg);Here, assertion is any expression that returns boolean true or false. The msg is a JavaScript string or an object. The assertion should be false to display the msg on console.ExampleLet us see an example for the console.assert() method − ... Read More

HTML DOM ColumnGroup span Property

AmitDiwan
Updated on 07-Aug-2019 14:19:44

101 Views

The HTML DOM ColumnGroup span property is associated with the span attribute of the HTML element. The ColumnGroup span property set or returns the value of the span attribute of a column group. The span attribute is used to define the number of columns a element should span to.SyntaxFollowing is the syntax for −Setting the ColumnGroup span property −columngroupObject.span = numberHere, the number specifies the number of columns the element should span to.ExampleLet us look at an example for the ColumnGroup span property −    table, th, td {       border: 1px ... Read More

HTML DOM ColumnGroup object

AmitDiwan
Updated on 20-Feb-2021 05:48:37

124 Views

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

HTML DOM Column object

AmitDiwan
Updated on 20-Feb-2021 05:51:55

133 Views

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

HTML DOM Code object

AmitDiwan
Updated on 20-Feb-2021 05:53:21

152 Views

The HTML DOM Code object is associated with the HTML 5 tag. It is used for marking up a piece of code by surrounding it inside the element. The Code object basically represents element.SyntaxFollowing is the syntax for −Creating a code object −var a = document.createElement("CODE");ExampleLet us see an example for the HTML DOM code object −Live Demo Click the below button to create a CODE element with some text CREATE    function createCode() {       var x = document.createElement("CODE");       var t = document.createTextNode("print('HELLO WORLD')");       x.appendChild(t); ... Read More

HTML DOM Clipboard event

AmitDiwan
Updated on 07-Aug-2019 13:38:41

426 Views

The HTML DOM Clipboard event is used to provide information regarding modification of the clipboard. The events can be cut, copy and paste. The Clipboard event can be used to make your site more accessible i.e. giving user information on how the clipboard is being modified.PropertiesFollowing is the property for Clipboard event −PropertyDescriptionclipboardDataTo return an object containing the data affected by the clipboard operation(cut, copy or paste).EventsFollowing are the event types belonging to the Clipboard event −EventDescriptiononcopyThis event fires when the content of an element is copied by the user.OncutThis event fires when the user cuts the content of an ... Read More

HTML DOM cite object

AmitDiwan
Updated on 20-Feb-2021 06:01:28

123 Views

The HTML DOM cite object is associated with the HTML element. The element is used to give reference to a cited creative work and title must be included. It can be painting, book, tv show, movies etc.SyntaxFollowing is the syntax for −Creating a cite object −var x = document.createElement("CITE");ExampleLet us see an example of the HTML DOM cite object −Live Demo Click the below button to create a CITE element. CREATE    function createCite() {       var x = document.createElement("CITE");       var t = document.createTextNode("The Starry night.");       ... Read More

HTML DOM Caption Object

AmitDiwan
Updated on 07-Aug-2019 12:23:10

164 Views

The HTML DOM Caption object is associated with the HTML element. The element is used for setting caption (title) of the table and should be the first child of the table. You can access caption element using the caption object.PropertiesNote: The below property are not supported in the HTML5.Following is the HTML DOM Caption Object property −PropertyDescriptionAlignTo set or return the caption alignment.SyntaxFollowing is the syntax for −Creating a caption object −var x = document.createElement("CAPTION");ExampleLet us see an example for the HTML DOM Caption object −    table, th, td {       border: ... Read More

Advertisements