soanvig / mm-jsr

Range input solution without dependencies
https://soanvig.github.io/mm-jsr
GNU Lesser General Public License v3.0
56 stars 16 forks source link

Add support for data-attributes if multiple HTML elements are rendered #94

Closed soanvig closed 3 years ago

soanvig commented 3 years ago

If JSR renders 5 sliders or 4 bars it would useful for them to have data-index or something like that which would allow to easily style selected elements. Label and sliders actually have data-key, so probably this can be used as well for things like bars.

For now it is possible, since HTML structure is not changing, therefore everything can be targetted with :nth-child but it's tedious to use. And because of flat structure of elements it is impossible to use other methods for selecting given elements.