Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What does id mean in html

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly explains "what does id refer to in html". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "what does id mean in html"?

In html, id is an abbreviation for "Identity document", meaning "identity number". This attribute is used to specify the unique id of an element, which can be used as a link anchor to change or add styles to an element with a specified id through JavaScript or through CSS.

The operating environment of this tutorial: windows10 system, HTML5 version, Dell G3 computer.

What does id mean in html

The id attribute specifies the unique id of the HTML element.

Id must be unique in the HTML document.

The id attribute can be used as a link anchor (link anchor) to change or add styles to elements with a specified id through JavaScript (HTML DOM) or through CSS.

Differences between HTML 4.01 and HTML5

In HTML5, the id attribute can be used for any HTML element (it validates any HTML element. But it doesn't have to work.

In HTML 4.01, the id attribute cannot be used for:, and.

Note: HTML 4.01 has strict restrictions on the value of id (for example, id values cannot start with a number in HTML 4.01).

Grammar

Attribute value

Id specifies the unique id of the element.

Naming rules:

Must start with the letter Amurz or amurz

Followed by characters: letters (A-Za-z), numbers (0-9), hyphens ("-"), underscores ("_"), colons (":"), and periods (".")

Value is case sensitive

Examples are as follows:

123 function displayResult () {document.getElementById ("myHeader") [xss_clean] = "Have a nice day!";} Hello World!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report