I have some nested elements and my HTML structure doesn't has any discipline. Also there is not any classname or id for selecting element considered. So, the only clue that I have is containing specific element.

**Note:** It should be noted, my HTML codes are dynamic. I mean is their structure is not identical all the time. Sometimes they are like this:

```
<div> <h1> <span> anything </span> </h1> <h5> anything> </h5> </div>

```

And sometimes else they are like this:

```
<div> anything </div> <div> <h2> anything </h2> <h5> anything> </h5> </div>

```

And sometimes else they are like this:

```
<div> <span> anything </span> </div> <div> <h5> anything> <h2> anything </h2> </h5> </div>

```

And so on ..! Well, As you see, I can not use none of these:

* `$(elmnt).closest("tag");`
* `$(elmnt).siblings("tag");`

Because as I said, the HTML code is not constant. Now I want to know, How can I select that `<div>` which is containing `<h5>`? So I want this output for three examples above:

```
<div> <h1> <span> anything </span> </h1> <h5> anything> </h5> </div>

<div> <h2> anything </h2> <h5> anything> </h5> </div>

<div> <h5> anything> <h2> anything </h2> </h5> </div>

```

Well, how can I do that?