I m working on an evaluation system for students. I want to change the grade of the student when the teacher clicks on it. I have 2 "grade" images that I switch between like that: "A" , after click "B" ... & so on. I now use a function that achieves this task, as follows:
function ChangeClass(object)
{
var objectClass = $(object).attr( class );
if (objectClass == zero ) {
$(object).removeClass( zero );
$(object).addClass( one );
}
else if (objectClass == one )
{
$(object).removeClass( one );
$(object).addClass( two );
}
else if (objectClass == two ) {
$(object).removeClass( two );
$(object).addClass( zero );
}
}
But I don t like this solution, I guess there might be something easier in Jquery or something to change the buttons shape, or switch images with. If you have any ideas, please share them =)