jquery find data-id value Edit

Murugan Andezuthu Dharmaratnam | 31 August 2020 | 3

HTML data-* Attributes is used to store custom data & it allows the ability to embed custom data attributes on all html elements. The data-* attributes contains of two parts, an attribute name and value

  • attribute name should contain only lower case letters and should start with a data- followed by characters and should be atleast one character long.
  • The attribute value can be any string

Sample Code

$(this).attr("data-id") 

or

$(this).data("id")