Create Definition Lists in HTML5

Yaswanth Varma
Updated on 05-Sep-2022 14:10:37

2K+ Views

A description list—previously known as a definition list—offers an organised arrangement of a term and its definition. For defining a definition list, the following tags are used − − This is the list of definitions. It stores terms and their definitions as tables of rows and data. − This is the term used to define. It keeps the phrase under definition. − This serves as the description or definition. It contains the definition of a particular term. Using these tags, Following are the examples… Example In the following example we are using , , ... Read More

Check Editable Content of HTML Element

Yaswanth Varma
Updated on 05-Sep-2022 14:08:41

970 Views

The contenteditable attribute indicates whether or not an element's content is editable. If the content is found to be editable, the browser will allow editing by modifying its widgets. This attribute must always take one of these two values below − true, or an empty string − indicating that the content is editable false − indicating that the content is not editable If the attribute does not take any of the values mentioned above, it is declared an empty string and will, by default, become an editable content. Note − If an element's contenteditable attribute is not ... Read More

Use Year Input Type in HTML

Yaswanth Varma
Updated on 05-Sep-2022 13:44:45

24K+ Views

Use the placeholder attribute to let the user know that the required input format is YYYY, and the , min, and max attributes to limit the range of possibilities. To the first argument of a new Date, pass the value or valueAsNumber during the input event () Following are the examples… Example In the following example we are using placeholder to mention that the input type is year. DOCTYPE html> document.querySelector("input[type=number]") .oninput = e => console.log(new Date(e.target.valueAsNumber, 0, ... Read More

Add Header Cells Related to a Cell in HTML

Yaswanth Varma
Updated on 05-Sep-2022 13:42:38

365 Views

The headers attribute in HTML text along with the td and th tags allows us to add one or more header cells. It holds the value header id, which specifies a list of ids for one or more header cells that the table header cell is associated to, separated by spaces. Syntax Content.. Following are the examples… Example In the following example we are using headers to add required headercells in our table. DOCTYPE html> table { ... Read More

Execute Script When Content is Cut in HTML

Yaswanth Varma
Updated on 05-Sep-2022 13:41:48

249 Views

Oncut attribute triggers when the user cuts the content of an element. Although all HTML elements supported the oncut attribute, cutting content was not allowed unless the element's contenteditable attribute was set to "true." Following are the examples… Example: Cutting some text in using In the following example we are excuting a javascript for cutting some text in an element using the oncut attribute. DOCTYPE html> function myworld() { ... Read More

Specify a Unique ID for an Element in HTML

Yaswanth Varma
Updated on 05-Sep-2022 13:40:16

2K+ Views

For each HTML element, the id attribute specifies a special id. The id attribute's value must be distinct across the HTML content. A specific style declaration in a style sheet is referenced using the id attribute. JavaScript also uses it to access and modify the element with the given id. Following are the examples… Example In the following example we are using pointing to id name ”tutorial”. This will get styled according to the #tutorial. DOCTYPE html> #tutorial { ... Read More

Execute Script When Content is Copied in HTML

Yaswanth Varma
Updated on 05-Sep-2022 13:16:47

153 Views

When a user copies the content of an element, the oncopy event takes place.When a user copies an element, such as an image made using the element, the oncopy event also takes place.The elements with type="text" are the ones that often use the oncopy event. Following are the examples… Example In the following example we are running a javascript when copying text of an element. DOCTYPE html> function myFunction() { ... Read More

Specify Non-Relevant Element in HTML

Yaswanth Varma
Updated on 05-Sep-2022 13:14:18

238 Views

A boolean attribute makes up the hidden attribute. It indicates that an element is either not important yet or is no longer relevant when it is present. Elements that have the hidden attribute specified shouldn't be displayed by browsers.Another application of the hidden attribute is to prevent a user from viewing an element until a different requirement has been satisfied. Syntax ……… Following are the examples… Example We are using the hidden attribute to hide the element of the html script that is not relevant. DOCTYPE html> Heading This is ... Read More

Execute Script on Double Click in HTML

Yaswanth Varma
Updated on 05-Sep-2022 13:12:14

427 Views

The dblclick event is triggered when a pointing device button, such as the mouse's main button, is double-clicked, or when it is quickly clicked twice on the same element in a brief period of time. Following are the examples… Example: Using ondblclick attribute in HTML In the following example we are using ondblclick attribute for creating the double click event using HTML. DOCTYPE html> HELLO EVERYONE :):) Double Click the text "HELLO EVERYONE" to see the effect. ... Read More

Include a Table Caption in HTML

Yaswanth Varma
Updated on 05-Sep-2022 13:08:43

656 Views

The element is used to add caption to an HTML table. A "caption" must be the first descendant of a parent "table" in an HTML document, however it can be visually positioned at the bottom of the table using CSS. SyntaxTable title... The element contains global attributes and deprecated align attributes (left, right, top, bottom). This element must be used immediately after the table tag is opened as it is a table caption. If a figure needs to be captioned instead of a table use . Following are the examples… Example In the following example we are ... Read More

Advertisements