 She was married to Judah's son Er, but Er died, leaving Tamar childless.Under levirate law, Judah's next son, Onan, was told to have sex with Tamar and give her a child, but when Onan slept with her, he "spilled his seed on the ground" rather than give her a child that would belong to his brother.Then Onan died too.