Before post, there has been concern in some HTML 5 is remarkable but less use of the API or tips, continue to summary some this time.
1) element. The classList

code is as follows:


<Section contextmenu="mymenu" >
<! -
the For the purpose of cleanliness,
I "l l put my menu inside the element that will use it
- >
<! - add the menu - >
<The context menu type="" id=" mymenu >"
<Refresh menuitem label="Post" icon="/images/Refresh - icon. PNG" ></menuitem>
<menu label="Share>

3)element.dataset
代码如下:


则通过下面这些可以获得键值对,这个用在jquery mobile中很实用:

代码如下:


//获得元素
var element=document.getElementById("myDiv");
//获得id
var id=element.dataset.id;
//获得data-my-custom-key"
var customKey=element.dataset.myCustomKey;

//set the new value element. The dataset. MyCustomKey="Some other value";

4) postMessage API
code is as follows:


//From the window or frame>

  code is as follows:  


<Input an autofocus="autofocus"/>
<The button an autofocus="autofocus" >Hi! </button>
<Textarea autofocus="autofocus" ></textarea>


This concludes the body part