JSFiddle - React, Tailwind, and code Playground
by tu genhua
HTML
<div style="behavior:url(#default#userData)" id="dataStore">IE用户数据</div>
<input value="IE下保存数据" type="button" id="IESave">
<input type="button" value="IE下获取数据" id="IEGet">
<input type="button" value="IE下删除数据" id="IERemove">
JavaScript
var dataStore = document.getElementById("dataStore");
$("#IESave").click(function(e){
dataStore.setAttribute("name","tugenhua");
dataStore.setAttribute("book",'111111');
dataStore.save("bookInfo");
});
// IE下获取数据
$("#IEGet").click(function(){
dataStore.load("bookInfo");
alert(dataStore.getAttribute("name"));
alert(dataStore.getAttribute("book"));
});
// IE下删除数据
$("#IERemove").click(function(){
dataStore.removeAttribute("name");
dataStore.removeAttribute("book");
dataStore.save("bookInfo");
});