html - how to get custom attribute of option tag in dropdown?

前端 未结 7 1268
小鲜肉
小鲜肉 2020-12-08 06:54

If I have this code:

  
    
    
​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​

jsFiddle DEMO

As a side note:

Don't use inline javascript in your HTML. You want to separate your business logic from your UI. Create a javascript event handlers instead to handle this. (jQuery / Angular / etc)

提交回复
热议问题