html5 自定义标签取值

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script>
window.onload=function(){
/* var oDiv=document.getElementById('div1');
alert(oDiv.dataset.yaoyuan);*/ var oDiv=document.getElementById('div2');
alert(oDiv.dataset.yaoyuanTop);
}
</script>
</head>
<body>
<div id="div1" data-yaoyuan="遥远">div</div>
<div id="div2" data-yaoyuan-top="遥远2">div2</div>
</body>
</html>
上一篇:六、Django学习之基于下划线的跨表查询


下一篇:SqlServer表结构查询