194
rated 0 times
[
200]
[
6]
/ answers: 1 / hits: 25513
/ 10 Years ago, thu, january 22, 2015, 12:00:00
I have this html:
<select onchange=check_status(this); name=status[171]>
<option selected=true value=open data=04f2cf35e4d7a1c0158459fd0450a605>open</option>
<option value=in_process data=04f2cf35e4d7a1c0158459fd0450a605>pending</option>
<option value=finished data=04f2cf35e4d7a1c0158459fd0450a605>finished</option>
<option value=canceled data=04f2cf35e4d7a1c0158459fd0450a605>canceled</option>
</select>
and js
function check_status(obj){
var uid = obj.getAttribute('data');
alert(uid);
}
but it always alerts null instead of data value
Where is the problem guys? Thanks
More From » javascript