Found 10483 Articles for Web Development

HTML DOM console.assert() Method

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

132 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

105 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

125 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

134 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

153 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

427 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

124 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

Built-in javascript constructors?

Lokesh Yadav
Updated on 09-Dec-2022 05:43:25

1K+ Views

In this article, we are going to discuss about the Built-in JavaScript constructors with appropriate examples in JavaScript. Javascript has provided some built-in constructors for native objects. These built-in functions include Object(), String(), Boolean(), RegExp(), Number(), Array(), Function(), Date(). Note We cannot include Math object in those built-in constructors because Math is a global object. The 'new' keyword cannot be used with Math. Let’s understand this concept in a better way with the help of examples further in this article. Example 1 This is an example program to illustrate about the inbuilt constructor String(). ... Read More

HTML DOM Caption Object

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

165 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

HTML DOM Canvas Object

AmitDiwan
Updated on 20-Feb-2021 06:09:55

348 Views

The HTML DOM Canvas object is associated with the element introduced in HTML5. The tag is used to draw graphics with the help of JavaScript. The canvas acts as a container for graphics. On canvas, we can draw lines, shapes etc.PropertiesFollowing are the properties for Canvas Object −PropertyDescriptionfillStyleTo set or return the color, gradient or pattern that is used to fill the drawing.strokeStyleTo set or return the color, gradient, or pattern used for strokes.shadowColorTo set or return the color to be used for shadows.shadowBlurTo set or return the blur level of shadows.shadowOffsetXTo set or return the horizontal distance ... Read More

Advertisements