Any person who is a party to a civil or criminal action in which a jury has been selected to try the case and who, while the legal action is pending or after the conclusion of the trial commits a battery against any juror or alternate juror who was selected and sworn in that legal action shall be punished by a fine not to exceed five thousand dollars ($5,000), or by imprisonment in the county jail not exceeding one year, or by both such fine and imprisonment, or by the imprisonment in the state prison for 16 months, or for two or three years.