---
title: Quick Search Element Placement
slug: template-js/quick-search-element-placement
docTags: 
createdAt: 2025-08-15T14:35:10.668Z
---

Sometimes you need to have more control over the exact placement of the results for Quick Search. Luckily there is a setting in the library that allows you to specify this using any element on the page.&#x20;

```javascript
// Wait for the Klevu library to be ready
window._klvReady = window._klvReady || [];
window._klvReady.push(function(){
    klevu({
        search: {
            // Tell Klevu to use this as the target to show Quick Search results
            searchBoxTarget: document.querySelector("#myCustomTarget"),
        }
    });	

    // If Quick Search has already been initialized, rebuild it to use the new settings
    if (klevu.getObjectPath(klevu.settings, 'flags.bindLocalBoxes.build', false)) {
        klevu.rebuild.quick();
    }	
});
```

The code above will wait for the Klevu library to be loaded, then will specify the element to use for the searchBoxTarget.&#x20;

:::hint{type="warning"}
Note the value you pass to searchBoxTarget must be a reference to the element itself and not just a CSS selector.&#x20;
:::

Sometimes the Quick Search has already loaded and initialized by the time you run this code, so the example above will also rebuild Quick Search to use the new setting if needed.&#x20;

