Skip to content

Add subContentId as attribute to interaction div#331

Open
skills-up wants to merge 4 commits intoh5p:masterfrom
skills-up:patch-1
Open

Add subContentId as attribute to interaction div#331
skills-up wants to merge 4 commits intoh5p:masterfrom
skills-up:patch-1

Conversation

@skills-up
Copy link

Allows uniquely accessing the interaction via JS and CSS

@otacke
Copy link
Contributor

otacke commented Aug 15, 2024

If you add custom attributes to HTML elements, you should follow the data-* syntax for that purpose, please cmp. https://developer.mozilla.org/en-US/docs/Learn/HTML/Howto/Use_data_attributes

@skills-up
Copy link
Author

I've actually followed already included aria-label convention

@otacke
Copy link
Contributor

otacke commented Aug 15, 2024

I am not sure if I understand what you are referring to. aria-label is an inherent attribute of HTML DOM elements. sub-content-id is not and should be using the data- prefix reserved for custom attributes.

@skills-up
Copy link
Author

Added the prefix, as required.

@otacke
Copy link
Contributor

otacke commented Aug 15, 2024

I didn't say it was required, but that one should do it that was as it is recommended. I am not part of the H5P core team anyway, so feel free to ignore me :-D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants