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

Does html5 support Boolean value attributes?

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)05/31 Report--

This article introduces the knowledge of "whether html5 supports Boolean value attributes". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Html5 supports the Boolean value attribute; the Boolean value attribute refers to the attribute whose value is true or false. If you set the attribute value to true, you can also set the attribute name to the attribute value, or set the empty string to the attribute value, or if the attribute value is set to false, you can not use this attribute.

This article operating environment: Windows10 system, html5 version, Dell G3 computer.

Does html5 support Boolean value attributes?

Html5 supports Boolean value attributes

There are some attributes of elements in html. When only the attribute name is written and the attribute value is not specified, the table evaluates the attribute value to true, and if the attribute value is set to false, the attribute is not used. In addition, when you want to set an attribute value to true, you can also set the attribute name to the attribute value, or the empty string to the attribute value. For example, disabled and readonly in the input element are such attributes.

Attributes of Boolean type in html

1 、 noshade

Used to indicate the presence or absence of shadows, often used in tags

2 、 ckecked

It is used to indicate whether it is selected by default. It is often used in radio buttons and multi-select buttons. It should be noted that the same name is needed in order to achieve the effect of a radio box.

3 、 selected

Used to indicate whether to give priority to display, used in drop-down forms and drop-down forms only

4 、 autofocus

Used to automatically get focus, used in tags with input boxes

5 、 readonly

Read-only attribute, which can get the focus, and the data will be passed to the background, suitable for text boxes that can be entered, such as text

6 、 disabled

Disable the property so that it cannot gain focus, the data cannot be passed to the background, and can be used in both input text and buttons

7 、 require

Used to indicate that it must be selected, often used in labels

That's all for "whether html5 supports Boolean value attributes". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

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