JS 从HTML页面获取自定义属性值

 

 

<select id="nextType" data-parameter="@Model.NextType">
<option value="" >请选择</option>
</select>

var data_nextType = document.getElementById("nextType").getAttribute("data-Parameter");

var data_nextType = document.getElementById("nextType").attributes['data-Parameter'].nodeValue;

 

 

posted on 2017-08-22 15:49  LJD泊水  阅读(1937)  评论(0编辑  收藏  举报