They asked, “Teacher, Moses wrote that if a man’s brother dies and leaves a wife but no children, then that man must marry the widow and have children for his brother.
Then Judah said to his daughter-in-law Tamar, “Go back to live in your father’s house, and don’t marry until my young son Shelah grows up.” Judah was afraid that Shelah also would die like his brothers. So Tamar returned to her father’s home.
Judah recognized them and said, “She is more in the right than I. She did this because I did not give her to my son Shelah as I promised.” And Judah did not have sexual relations with her again.
Then Judah said to Er’s brother Onan, “Go and have sexual relations with your dead brother’s wife. It is your duty to provide children for your brother in this way.”