I'm working on star ratings. I reused code from Olga on Codepen. And I want to display dynamically the rate that the user selected like this : "You gave this product : 3/5".
I'm beginning in JS and jQuery so my ideas where limited ; I tried this just to test but it didn't show anything
if ($('.rate2-star5').is(':checked')) {
alert("checked");
}
<head>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/rateYo/2.3.2/jquery.rateyo.min.css">
</head>
<div class="row">
<fieldset class="rate">
<input class="rate2-star5" type="radio" name="rate2" value="5" />
<label for="rate2-star5" title="Awesome">5</label>
<input class="rate2-star4" type="radio" name="rate2" value="4" />
<label for="rate2-star4" title="Very good">4</label>
</fieldset>
</div>
<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/rateYo/2.3.2/jquery.rateyo.min.js"></script>
Here what I want the result to look like : https://i.stack.imgur.com/GEoOX.jpg