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

后端 未结 7 901
面向向阳花
面向向阳花 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:20

      $(this).attr('data-value');
      

      This will return the string value with the leading 0.

    提交回复
    热议问题