Who was Onan?
Onan was a "son" of Judah (Gen 38:4,8-10; 46:12; Nu 26:19; 1 Ch 2:3); "The story of the untimely death of Er and Onan implies that two of the ancient clans of Judah early disappeared" (Curtis, Chron, 84).
Judah plainly attributes the death of his sons in some way to Tamar herself. The name is allied to Onam.
IBSE, "Onan" (in the public domain) with minor edits.