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

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

      have you tried?:

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

      or

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

    提交回复
    热议问题