Any person claiming to be elected to an office to be exercised in and for any county, district or hundred may contest the right of any person declared to be duly elected to such office for any of the following causes:
(1) For malconduct on the part of the election officers or clerks holding the election, or any one of them;
(2) When the person whose right to the office is contested was not at the time of the election eligible to such office;
(3) When the person whose right is contested has given to any elector or inspector, judge or clerk of election, any bribe or reward or shall have offered any bribe or reward for the purpose of procuring his or her election;
(4) On account of illegal votes.