Question: I want to use closest to traverse select an item, my html as below :

```
<span id='target'></span>
<a></a>

```

jquery

```
assume 'a' = $(this),
then I do $(this).closest('#target');

```

but it seem it doesn't select the #target.. what's wrong here?

Answer: 
`Closest('#target')` isn't going to work here since the `a` tag is a sibling to `span#target` not a parent. Use `Closest` to find the parent element for both of these and then do a find to get your `target` span, or just use `.prev` to get sibling `target` span.

```
$(this).closest("div").find("#target");

```

or

```
$(this).prev("#target");

```
Closes does not check siblings, it check element and its parents [jQuery.closest](http://api.jquery.com/closest/)

> 
> For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.
> 
> 
> 

In your case `<a>` and `<span>` are siblings, not parent/child - so using `closest` will not find `span` starting from `a`.