title: Star rating in ASP.NET Core
body: <p>I am trying to create a star rating system on ASP.NET Core and I currently have this code. However, I am unable to hover over it to change the stars.</p>
  <pre class="lang-html prettyprint-override"><code>&lt;div class=&quot;form-group&quot;&gt;
     &lt;span class=&quot;text-warning&quot;&gt;
        &lt;i class=&quot;ratingStar fas fa-star&quot;&gt;&lt;/i&gt;
        &lt;i class=&quot;ratingStar far fa-star&quot;&gt;&lt;/i&gt;
        &lt;i class=&quot;ratingStar far fa-star&quot;&gt;&lt;/i&gt;
        &lt;i class=&quot;ratingStar far fa-star&quot;&gt;&lt;/i&gt;
        &lt;i class=&quot;ratingStar far fa-star&quot;&gt;&lt;/i&gt;
      &lt;/span&gt;               
  &lt;/div&gt;
  
  &lt;script&gt;
      $(&quot;.ratingStar&quot;).hover(function () {
          $(&quot;.ratingStar&quot;).addClass(&quot;far&quot;).removeClass(&quot;fas&quot;);
  
          $(this).addClass(&quot;fas&quot;).removeClass(&quot;far&quot;);
          $(this).prevAll(&quot;.ratingStar&quot;).addClass(&quot;fas&quot;).removeClass(&quot;far&quot;);
      });
  &lt;/script&gt;
  </code></pre>