I am looking to create a functionality where a div is displayed under an input field when the user clicks on or focuses on the input field. The div should be hidden when the focus is removed or when the user clicks outside of the input field or the div itself. In this specific example, clicking on the input field displays the div, and clicking outside of the input field hides it.
However, I want the div to remain visible under certain conditions:
1. When the input field is focused/clicked.
2. When the click event occurs within the div(.options).
The div should only be hidden when:
1. The input field loses focus and the click event is not within the div.
2. The click event occurs outside of the div.