Jquery get attribute data Get value of data attribut in Jquery. The correct attribute is value, or if you want a custom attribute, use a data-prefix (data-val, for instance). You can have multiple data attributes on an element and be used on any HTML element. Your current markup is invalid. attr() method. Oct 18, 2016 ยท Hi I am trying to get the image data from img tag using jquery. attr() function to get w3c invalid attributes. Answer: Use the CSS Attribute Selector. . Ask questions, find answers and collaborate at work with Stack Overflow for Teams. prbjimuxviysraykexfusvantkddthufdpgmpkfenqfkowfrkuzjcamisclpaffcy