"Give Points JS & Bootstrap"
Bootstrap 3.1.0 Snippet by burakulker

<link href="//netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//netdna.bootstrapcdn.com/bootstrap/3.1.0/js/bootstrap.min.js"></script> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <!------ Include the above in your HEAD tag ----------> <div class="container"> <i id="Point1" onmouseover="GivePoints(1,1)" onmouseout="GivePoints(1,2)" onclick="GivePoints(1,3)" class="glyphicon glyphicon-star-empty"></i> <i id="Point2" onmouseover="GivePoints(2,1)" onmouseout="GivePoints(2,2)" onclick="GivePoints(2,3)" class="glyphicon glyphicon-star-empty"></i> <i id="Point3" onmouseover="GivePoints(3,1)" onmouseout="GivePoints(3,2)" onclick="GivePoints(3,3)" class="glyphicon glyphicon-star-empty"></i> <i id="Point4" onmouseover="GivePoints(4,1)" onmouseout="GivePoints(4,2)" onclick="GivePoints(4,3)" class="glyphicon glyphicon-star-empty"></i> <i id="Point5" onmouseover="GivePoints(5,1)" onmouseout="GivePoints(5,2)" onclick="GivePoints(5,3)" class="glyphicon glyphicon-star-empty"></i> </div>
function GivePoints(Point, Rank) { if (Rank == '1') { for (var i = Point; i > 0; i--) { $("#Point" + i).attr("class", "glyphicon glyphicon-star"); } } else if (Rank == '2') { for (var i = Point; i > 0; i--) { $("#Point" + i).attr("class", "glyphicon glyphicon-star-empty"); } } else { for (var i = 5; i > 0; i--) { $("#Point" + i).attr("onmouseover", "").attr("onmouseout", ""); } for (var i = Point; i > 0; i--) { $("#Point" + i).attr("class", "glyphicon glyphicon-star"); } for (var i = Point + 1; i < 6; i++) { $("#Point" + i).attr("class", "glyphicon glyphicon-star-empty"); } } }

Related: See More


Questions / Comments: