I have a button, on click event on that I need to set value of next input hidden type element. I am trying below code - 

```
<span id="clear_promotion_brand_search" class="myButtonClass"><i class="fa fa-times"></i></span>
<span id="error_brand" class="show-error-msg"></span>
<input type="hidden" name="promotion_brand_id" value="" data-id="brand" class="search-id is-validate form-fields-value">

$(document).on('click','.myButtonClass',function(e){
  console.log($(this).closest(".search-id").length); // returning 0
  console.log($(this).next(".search-id").val()); // returning undefined
  if($(this).next(".search-id").length){
    var myval = $(this).next(".search-id").find('input[type=hidden]').val();
    console.log('Val -'+myval);
  }
});

```

What am I doing wrong?