In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article will explain in detail what are the five common global attributes in HTML5. The content of the article is of high quality, so the editor will share it with you for reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.
The concept of "all properties" has been added to HTML5. The so-called global attribute refers to the attribute that can be used for any element. Today, we will introduce three common global attributes in detail.
ContentEditable attribute
ContentEditable is developed by Microsoft. A global property that is decompiled and applied by other browsers. Its main function is whether the user is allowed to edit the content of the element, the edited element must be the element that gets the focus of the mouse, and a caret is provided after clicking, prompting the user to allow editing of the content in the element. The contentEditable property is a Boolean property that can be specified as ture or false. The attribute also has an inherit state of the hidden attribute, which is true, which allows the user to edit; when false, the element cannot be edited by the user; when not specified, it is determined by the inherit state, and if the parent element is editable, the element is also editable. Supporting contentEditable attribute elements are A, DD, DIR, DIV, BUTTON, FORM, DL, DT, FONT, DFN, hn, CODE, ABBR and so on.
DesignMode attribute
The main function of the designMode attribute is to specify whether the entire page is editable. When the page is editable, any element in the page that supports the contentEditable attribute becomes editable. The designMode property has two values, "on" and "off". When the property is "on", the page is editable; when the property is "off", the page is not editable. However, the support varies from browser to browser. IE8 does not support the designMode attribute, IE9 supports the designMode attribute, fixfox and Opera browsers support the designMode attribute, and Chrom and Safari browsers support the designMode attribute in the embedded frame.
Hidden attribute
The hidden attribute is allowed for all elements in HTML5. It is similar to the hidden attribute in the input element, making the element invisible. The hidden property is set to ture and the element is invisible; when the hidden attribute is set to false, the element is visible.
Spellcheck attribute
The spellcheck attribute is mainly a new attribute provided for the two text input boxes, the input element and textarea, and its function is to check the spelling and grammar of the input. It has a special feature, that is, it must declare the property value true or false. If the element is a readonly attribute or the disabled attribute is true, no spell checking is performed. Browsers such as Firfox, IE, Chrome, Safari, and so on support this attribute.
Tabindex attribute
In the concept of program development, tabindex refers to constantly tapping the Tab key to make the controls in the window or page get the focus, traversing the controls of the window, and the tabindex of each control represents the first to be accessed. Previously, this attribute was useful for editing web pages, but now the traversal order is determined based on the location of the elements, so you don't need it. However, tabindex has a function, only link elements and form elements can get focus through keystrokes. If you use the tabindex attribute on the element, you can also give the element focus, and when you execute the focus () statement, you can give the element focus. But there is a problem: the element gets focus through tab, and at this point we don't want the element to get focus, which is not what we want.
This problem can be solved by setting the tabindex value of the element to a negative number. When tabindex is negative, you can programmatically give the element focus, but pressing the Tab key does not allow the element to get focus, which is useful on complex pages. The ingenious use of this attribute in HTML5 plays a big role.
This is the end of what are the five common global attributes in HTML5. I hope the above content can be helpful to you and learn more. If you think the article is good, you can share it for more people to see.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.