New Way to Store Custom Data
Read OriginalThis article discusses the HTML5 feature of custom data attributes (e.g., data-validation). It explains their purpose for storing script-related data privately on elements, compares them to existing workarounds like misusing the class attribute, and details two JavaScript access methods: getAttribute() and the newer, not-yet-widely-supported dataset property.
Comments
No comments yet
Be the first to share your thoughts!
Browser Extension
Get instant access to AllDevBlogs from your browser
Top of the Week
No top articles yet