I am using JQuery with the Star Rating Plugin from the following site http://www.fyneworks.com/jquery/star-rating/# . If I use the rating system in Asp markup there is no problem. However, if I dynamically create the rating system and follow the same steps it only shows up as radio buttons instead of stars.
Here is the markup that works as expected:
<input name="star4" id="Radio1" type="radio" class="star" />
Here is the relevant jquery script that does not work and only shows the unconverted radio elements:
function loadMovies(firstMovie, lastMovie) {
for (incMovie = firstMovie; incMovie <= lastMovie; incMovie++) {
$('<input>', {
type: "radio",
id: 'star1-' + incMovie,
name: "star",
}).appendTo($('#sngMovie' + incMovie));
$('#star1-' + incMovie).addClass('star');
}
}
The radio buttons is supposed to be transformed into the star rating system when it has the "star" class. But it does not work when the class is added in JQuery. The radio buttons were not converted even when I tried the following:
Markup
<input name="star4" id="Radio1" type="radio" />
Script
$('#Radio1').addClass("star");
I need to be able to create the rating system dynamically. So I need some help on getting the radio buttons to be transformed to the rating system using jquery addClass or something similar.