You need just to have a div to build the Raty.

<div id="star"></div>


Used when we want starts with saved rating.

$('#star').raty({ score: 3 });

Score callback

If you need to start you score depending of a dynamic value, you can to use callback for it.
You can pass any value for it, not necessarily a data- value. You can use a field value for example.

<div id="star" data-score="1"></div>
  score: function() {
    return $(this).attr('data-score');