problem with my user control with javascript

  • Thread starter Thread starter ThunderMusic
  • Start date Start date
T

ThunderMusic

Hi,
Maybe I'm not in the good forum, but I try anyway.

I have the following code:

<script language="javascript">
function setRating(ImagePrefixId, Rating, divID) {
for (var cpt=10; cpt>0; cpt--) {
var img = document.getElementById(ImagePrefixId+cpt);
if (img) {
if (cpt<=Math.floor(Rating)){
img.cssClass='imgRatingGold';}
else if (Rating == (cpt-0.5)){
img.cssClass='imgRating50pct';}
else{
img.cssClass='imgRatingGrey';}
}
}
}
</script>

and here's an exemple of a used cssClass :

div.imgRatingGrey
{
position: relative;
width: 20px;
height: 18px;
background-image: url("/Site/images/greystar.gif");
}

When I try them individually, it works fine, but when the script tries to
change them, it does not work. It goes in the ifs (I tried with some
alert(cssClass) and got the good values), but no change is done in the page
display... so I was wondering if someone sees any error...

thanks

ThunderMusic
 
I solved my problem, the property is not cssClass it's className... so now
it works
 
Back
Top