I have this selector:
1
Do removeClass first then addClass
$("#valueAdd").removeClass().addClass("sub_" + typeid);
http://api.jquery.com/removeClass/
$("#valueAdd")[0].className = "sub_" + typeid;