But Er was a wicked man in the LORD's sight, so the LORD took his life.
Then Judah said to Er's brother Onan, "You must marry Tamar, as our law requires of the brother of a man who has died. Her first son from you will be your brother's heir."
But Onan was not willing to have a child who would not be his own heir. So whenever he had intercourse with Tamar, he spilled the semen on the ground to keep her from having a baby who would belong to his brother.
But the LORD considered it a wicked thing for Onan to deny a child to his dead brother. So the LORD took Onan's life, too.
Then Judah told Tamar, his daughter-in-law, not to marry again at that time but to return to her parents' home. She was to remain a widow until his youngest son, Shelah, was old enough to marry her. (But Judah didn't really intend to do this because he was afraid Shelah would also die, like his two brothers.) So Tamar went home to her parents.
In the course of time Judah's wife died. After the time of mourning was over, Judah and his friend Hirah the Adullamite went to Timnah to supervise the shearing of his sheep.
Someone told Tamar that her father-in-law had left for the sheep-shearing at Timnah.
Tamar was aware that Shelah had grown up, but they had not called her to come and marry him. So she changed out of her widow's clothing and covered herself with a veil to disguise herself. Then she sat beside the road at the entrance to the village of Enaim, which is on the way to Timnah.
Judah noticed her as he went by and thought she was a prostitute, since her face was veiled.
So he stopped and propositioned her to sleep with him, not realizing that she was his own daughter-in-law. "How much will you pay me?" Tamar asked.
"I'll send you a young goat from my flock," Judah promised. "What pledge will you give me so I can be sure you will send it?" she asked.