How do we get the closest previous element in a complex document?

How do we get the closest previous element in a complex document?

We were trying to get the closest previous element using jQuery using the codes given here

In this fiddle, the same code is not working, without throwing any console errors.

var lastObj = $("#SomeButton"); var parent = lastObj.parent(); var previousObject = parent.prevUntil(".title:has(h4)").prev().find("h4"); alert(previousObject.text());

Can someone please help me understand the problem here?