HTML elements refer to content content . For my task, I have to make sure that I do not host interactive content sites.
I can currently traverse node parents to make sure none of them are of type <a>, <button>, <details>, <embed>, <iframe>, <keygen>, <label>, <select>, and <textarea> . All of these elements are part of the Interactive Content category.
Other types may also be interactive.
<audio> if a control attribute is present<img> if usemap attribute is present<input> if the type attribute is not in a hidden state<menu> if the type attribute is in the toolbar state<object> if usemap attribute is present<video> if a control attribute is present
In addition, any element with the tabindex attribute is considered interactive .
These rules are part of the HTML specification and are well documented, but the kind of pain that needs to be tracked. Is there an easier way to check which categories of content an item belongs to?
source share