The present invention relates to a hair cosmetic containing the following components (A) and (B):(A) a compound represented by the following general formula (1) or a salt thereof:wherein a broken line represents the presence or absence of a π bond; R1 represents a hydroxy group or an acetoxy group; R2 represents a hydrogen atom or -COOR (where R is a hydrogen atom, a methyl group, or an ethyl group); and R3 represents a hydrogen atom, an acetyl group, a methyl group, or an ethyl group, and(B) at least one polymer selected from the group consisting of polyvinyl alcohol and polyvinylpyrrolidone each having an average degree of polymerization of 700 or more and 10,000 or less.