Strange little glitch in a function. I need to replace a class for an element. I can add class, but I don't want that. I need to replace the class. And it's not working. The variable passes with .addclass. and not the other way. maybe there's some syntax I'm not understanding?
here's what I've got:
$('#dropdown1a li').click(function(){
var chosen_leaf = $(this).attr('id');
$('#uniqueleaf').css({display:"block"},800);
$('#pic4').attr("src", "images/leaf_shapes/23/leafbg_13.gif");
$('#uniqueleaf').attr('class','chosen');
$('#leafshown').attr('class',chosen_leaf); // THIS doesn't work
// $('#leafshown').addClass(chosen_leaf); THIS WORKS
$('#uniquename').css({display:"block"},800);
});