Can I use HTML5 data-* attributes as boolean attributes? [duplicate]
问题 This question already has answers here : Are empty HTML5 data attributes valid? (4 answers) Closed 5 years ago . I want to use a custom boolean attribute to mark an element's contents as editable. I'm aware of the data-* attributes, but wasn't sure if they require a value. I don't need data-is_editable="false" , as the lack of the attribute would be equivalent. I only care if it's "true" (if the attribute exists). I know I can use other attributes like class but I don't want to as it seems