How can I get a HTML data value as a string with jQuery?

后端 未结 7 823
面向向阳花
面向向阳花 2021-01-31 18:02

I have the following in my source HTML:

  • Test
  • I want to get the value of th

    相关标签:
    7条回答
    • 2021-01-31 18:33

      You can use the attr() operator of jQuery:

      var abc = $(this).attr('data-value');
      
      0 讨论(0)
    提交回复
    热议问题