How to assign an ID to the search input using datatable.net

How to assign an ID to the global search box using datatable.net

If you want to assign an id on focus

$(document).ready( function () {
  var table = $('#dt').DataTable();
  
  $('#dt_filter label input').on( 'focus', function () {
    this.setAttribute( 'id', 'search' );
  });
} );

If you want to assign id when data is finished loading

initComplete : function() {
       $("#dt_filter input").prop( 'id', 'search_box' );
  },