How can I use Rate Yo jQuery star rating plugin with data attribute?
问题 How can I use Rate Yo jQuery star rating plugin with data attribute? Is there any way to set a default initial value via HTML attribute? Is it possible using data-rateyo-score to pass the score value. For example, If I want to start my score depending on a dynamic value, How can I use callback for it? My code is same as below: <div class="rateYo" data-rateyo-score="1"></div> I try below code: $('.rateYo').rateYo({ score: function() { return $(this).attr('data-rateyo-score'); } }); and this: $