Genesis 38:1-11 New Revised Standard Version (NRSV)
Judah and Tamar
38 It happened at that time that Judah went down from his brothers and settled near a certain Adullamite whose name was Hirah. 2 There Judah saw the daughter of a certain Canaanite whose name was Shua; he married her and went in to her. 3 She conceived and bore a son; and he named him Er. 4 Again she conceived and bore a son whom she named Onan. 5 Yet again she bore a son, and she named him Shelah. She[a] was in Chezib when she bore him. 6 Judah took a wife for Er his firstborn; her name was Tamar. 7 But Er, Judah’s firstborn, was wicked in the sight of the Lord, and the Lord put him to death. 8 Then Judah said to Onan, “Go in to your brother’s wife and perform the duty of a brother-in-law to her; raise up offspring for your brother.” 9 But since Onan knew that the offspring would not be his, he spilled his semen on the ground whenever he went in to his brother’s wife, so that he would not give offspring to his brother. 10 What he did was displeasing in the sight of the Lord, and he put him to death also. 11 Then Judah said to his daughter-in-law Tamar, “Remain a widow in your father’s house until my son Shelah grows up”—for he feared that he too would die, like his brothers. So Tamar went to live in her father’s house.