Skip to content Skip to sidebar Skip to footer

Bootstrap Star Rating Onclick Dont Fire

In my project I have a for loop that has a lot of divs. For each div I have evaluation with the star rating, I'm trying to trigger the onclick event but it doesn't work. I already

Solution 1:

if you inspect element after page loads, you don't click on .input-2 you click on .rating so easiest way would be like this

$('.rating').on('click',function(){ console.log("a"); });

Solution 2:

Jquery's live() function is deprecated. You should use $(el).click(function) or $(el).on('click', function)

Solution 3:

         $(document).ready(function(){
                $('.star').on('click',function(){
                console.log("a");
         });

Post a Comment for "Bootstrap Star Rating Onclick Dont Fire"