Genesis 38:9 (KJV) And Onan knew that the seed should not be his; and it came to pass, when he went in unto his brother's wife, that he spilled it on the ground, lest that he should give seed to his brother.
Then Judah said to Tamar his daughter-in-law, “Remain a widow in your father’s house, till Shelah my son grows up”—for he feared that he would die, like his brothers. So Tamar went and remained in her father’s house. Gen 38:11 (ESV)
Genesis 38:12 (KJV) And in process of time the daughter of Shuah Judah's wife died; and Judah was comforted, and went up unto his sheepshearers to Timnath, he and his friend Hirah the Adullamite.
Genesis 38:14 (KJV) And she put her widow's garments off from her, and covered her with a vail, and wrapped herself, and sat in an open place, which is by the way to Timnath; for she saw that Shelah was grown, and she was not given unto him to wife.
Genesis 38:16 (KJV) And he turned unto her by the way, and said, Go to, I pray thee, let me come in unto thee; (for he knew not that she was his daughter in law.) And she said, What wilt thou give me, that thou mayest come in unto me?
Genesis 38:18 (KJV) And he said, What pledge shall I give thee? And she said, Thy signet, and thy bracelets, and thy staff that is in thine hand. And he gave it her, and came in unto her, and she conceived by him.
Genesis 38:20 (KJV) And Judah sent the kid by the hand of his friend the Adullamite, to receive his pledge from the woman's hand: but he found her not.
Genesis 38:21 (KJV) Then he asked the men of that place, saying, Where is the harlot, that was openly by the way side? And they said, There was no harlot in this place.