Drop-Down Not Resetting to Display “All” Categories

I have a drop-down element that displays 4 categories. I need “Select Category” to display at the top of the 4 categories, and when chosen, all of the category items will redisplay in the associated repeater. The code below is working on another website but not on the site I’m currently working on. What could be the problem?

function loadjobs () {
wixData . query ( ‘jobs’ )
. limit ( 100 )
. ascending ( “category” )
. distinct ( “category” )
. then ( results => {
let distinctList = buildOptions ( results . items );
// unshift() is like push(), but it prepends an item at the beginning of an array
distinctList . unshift ({ “value” : ‘null’ , “label” : ‘Select Category’ });
// Call the function that builds the options list from the unique titles
$w ( “#iCategory” ). options = distinctList ;
});
}

Hi, You can use the following line of code to reset the value.

$w("#iCategory").value = "";

If this will not show anything in placeholder, then you can use the following code.

$w("#iCategory").value = "";
$w("#iCategory").placeholder = "Choose Category";

Rajjat,

Thank you for your prompt reply. I replaced $w ( " #iCategory " ). options = distinctList ;
with the lines of code you provided, separately, and neither worked. I’m not sure what the issue is.

Please don’t replace my code with the options line. Instead of that put my code below that line like
Options
Value & then
Placeholder