Html
<div>
<div>
<input type="text" class="search_input form-control" placeholder="Search..."></div>
<span>
<img src="images/btn-reset-search.png" class="clear_text" alt="">
</span>
</div>
I want to get the input field when I click on the image having classname: clear_text.
I tried :
$('.clear_text').parent().prev('input');
$(this).parent().prev('input');