I am using rateit plugin of jQuery for star rating. here is the plugin http://rateit.codeplex.com/
My code:
<link href="rateit.css" rel="stylesheet" type="text/css">
<script src="../src/jquery.rateit.js" type="text/javascript"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" type="text/javascript"></script>
<div class="rateit" id="rateitval" data-rateit-step="1" data-rateit-resetable='false'></div>
<input type="button" onclick="dis();">
<script type="text/javascript">
var tooltipvalues = ['bad', 'poor', 'ok', 'good', 'super'];
var v = 1;
$("#rateitval").bind('over', function(event, value) {
v = value;
$(this).attr('title', tooltipvalues[value - 1]);
});
function dis() {
alert(v);
}
</script>
I need to get the rate value given in the star as an alert when i click the button. But for my code, it shows me null for all values. Suggest me some solutions.