Who was Onan?

A son of Judah, his second by the Canaanite daughter of Shua. (Ge 38:2-4; 1Ch 2:3) After Onan's childless older brother Er was put to death by Jehovah for wrongdoing, Onan was told by Judah to perform brother-in-law marriage with Er's widow Tamar. If a son was produced, he would not be the founder of Onan's family, and the firstborn's inheritance would belong to him as an heir to Er; whereas if no heir came, Onan would get the inheritance for himself. When Onan had relations with Tamar, he "wasted his semen on the earth" instead of giving it to her. This was not an act of masturbation on the part of Onan, for the account says "when he did have relations with his brother's wife" he spilled his semen. Apparently it was a case of "coitus interruptus," in which Onan purposely prevented ejaculation of his semen into Tamar's genital tract. For his disobedience to his father, his covetousness, and his sin against the divine arrangement of marriage, not for self-abuse, Onan, himself also childless, was put to death by Jehovah.-Ge 38:6-10; 46:12; Nu 26:19.