It shall be unlawful to bet or wager money or other thing of value on any election held in this state. Any person violating the provisions of this section shall be guilty of a misdemeanor, and, upon conviction thereof, he shall forfeit the value of the money or thing so bet or wagered and shall be fined not more than $50.