search

Home  >  Q&A  >  body text

javascript - How to get the custom data attribute value of option using jquery

How to get the custom data attribute value of option using jquery

我想大声告诉你我想大声告诉你2742 days ago433

reply all(3)I'll reply

  • 習慣沉默

    習慣沉默2017-05-18 10:56:28

    You really answered, it seems that they are so spoiled that they are too lazy to check the API. They would rather ask a question on segmentfault. Do you think this is more efficient?

    reply
    0
  • 我想大声告诉你

    我想大声告诉你2017-05-18 10:56:28

    $('option').attr('data');

    reply
    0
  • 大家讲道理

    大家讲道理2017-05-18 10:56:28

    例:
    <p id="E1" data-some="test">
    var value = $('#E1').data('some');

    reply
    0
  • Cancelreply