I want to be able to inject elements to a container – say, list items to a list – individually and at any given time, but only once.
I'm aware that I can inject into specific positions using .append()
, .wrap()
and other DOM insertion techniques. As suggested here.
But what to do if I don't know the order in which the user chooses to inject them (if at all) ? Sure, I can create a whole self-made method that grants the right order and such … my actual question however is, if there is an HTML attribute which defines a native or semantic order. Similar to how the role
attribute provides semantics to an element.
I'm also aware that I can use the CSS construct display: table, table-footer-group, etc.
– but that limits me to just three "groups". I probably need more.