fredolss/rater-js

Is it possible to pass multiple elements to "element" property?

Dudo1985 opened this issue ยท 3 comments

Hi, I think it could be a good idea to pass an entire class as element (using document.querySelectorAll('.class') for example).

What do you think?

Best,
Dario

Hi,
Sorry for the delay. I have been on vocation. Thanks for the input. I reopened because it I think it's a good idea. I'm not sure how this will be implemented though. Maybe we should have a new property called "elements". I also have plans to make a jquery plugin for this component and then we we would have this feature available when using the plugin. Do you have any thoughts how it should work?

BR
Fredrik

Honestly I'm using this component just because it is working without Jquery :)

I'm not a big javascript expert (I'm studying it), and to achieve this, I do something like this:
search for a class with
var classFound = document.getElementsByClassName('findMe'),
and if the classFound.length is >0 then run a for inside it, and run raterJs inside that for

I see. Then I don't make the jquery plugin a priority. We can keep this open and I will think about how to best solve it. If anyone else has an idea about how to handle this then they can make a comment here.