Introduction
Here we create a Rate Control with the help of JavaScript.
Step 1: First we take three Images (Star1, Star2, Star3) of the stars in the Image Folder.
Step 2: After that we use the Image Control in our form and a label control (lblrate) to show the rating:
- <img id="img1" alt="" src="Image/Star1.png" width="20" />
- <img id="img2" alt="" src="Image/Star1.png" width="20" />
- <img id="img3" alt="" src="Image/Star1.png" width="20" />
- <img id="img4" alt="" src="Image/Star1.png" width="20" />
- <img id="img5 alt="" src="Image/Star1.png" width="20" />
- <asp:Label ID="lblrate" runat="server"></asp:Label>
Step 3: Now we write the JavaScript functions Show() and Hide().
Show(): With this function, we set the Image and Label like this: