r/programming • u/KerrickLong • Mar 09 '25
Introducing command And commandfor In HTML
https://developer.chrome.com/blog/command-and-commandfor
92
Upvotes
r/programming • u/KerrickLong • Mar 09 '25
View all comments
Show parent comment
-16
u/KerrickLong Mar 09 '25
It's often the case that your repeated elements for which you'd prefer relative selectors are repeated because each of them represents an entity stored in a database. For those, you can use the primary key and entity type to generate an ID and use it in both places. For example,
id="comment-4321".