PURE JS get selected option data attribute value returns Null

前端 未结 4 1166
星月不相逢
星月不相逢 2021-01-01 12:32

I have this html:

 and use code snipped from your question unmodified.

function check_status(obj) {
  var uid =  obj.options[obj.selectedIndex].getAttribute('data');
  alert(uid)
}

提交回复
热议问题