HTML global attributes

About global properties of HTML, HTML so they can express richer and instruments to provide more useful features.

A, HTML original property

accesskey, class, dir, id, lang, style, tabindex, title (often used not presented)

1,accesskey

Role: The browser is used to create a keyboard shortcut to activate and focusing elements.

Value: a keyboard characters such as O

Scope: This property has a support element <a>, <area>, <button>, <input>, <label>, <legend>,<textarea>

Note: Use this property could possibly be shielded when a new browser window opens link

<div> 
    <a href="https://www.baidu.com" accesskey="b"> Baidu </a> 
    <a href="https://www.taobao.com" accesskey="a"> Ali </a> 
    <a href="https://www.qq.com" accesskey="t"> Tencent </a>     
    <P> shortcut (alt + b) can jump to Baidu; shortcut ( alt + a) can jump to Ali; shortcut (alt + t) can jump to Tencent </ P> 
</ div>

2, you

Role: the direction of the text

Value: ltr / rtl / auto

3,tabindex

Role: the provisions of the tab order of elements

Value: number (1 is the first)

4,title

Role: provision of additional information about the elements, are prompt is displayed when the mouse over the text element.

Two, HTML5 new property

contenteditable,data-*,draggable,hidden,spellcheck

1 contenteditable

Role: Specifies whether the content can be edited in the browser

Value: true / false

Note: Setting document.designMode = 'on' time, anywhere on a page can be edited; used contenteditable = 'true' only to specific elements and acts element comprising

Mobile end: only support the property after moving the end ios5 and android3

2,draggable

Role: whether the user can drag elements

值: true / false / self

Note: The default links and images are draggable

3,hidden

Role: Shows or hides the element (and display: none same role)

值:hidden="" || hidden= "hidden"

4,spellcheck

Role: Specifies whether elements of spelling and grammar check for misspelled words will appear below the red line

Range: editable area (or contenteditable element form)

Value: true / false

Note: The mobile terminal support is not good

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Reference: https://www.xiaohuochai.cc/posts/5a7eefb01453972fd0a53eeb

Guess you like

Origin www.cnblogs.com/ckafter/p/11441709.html