conditioning in search function

Hi, I am new to corvid.
Now, I want to have a search function by selected check box(es), then it will show in input box, when press button, it will redirect to the page.

But, it cannot show the value in input box. May I know why?

function valueCombine_a() {

 let checkedValue1 = $w("#checkbox10").value;
 let checkedValue2 = $w("#checkbox11").value;
 let checkedValue3 = $w("#checkbox12").value;

if (checkedValue1 & checkedValue2) {
    console.log($w("#input1").value = checkedValue1 + ', ' + checkedValue2)
    }
 else if (checkedValue1 & checkedValue3) {
    console.log($w("#input1").value = checkedValue1 + ', ' + checkedValue3)
    }
 else if (checkedValue2 & checkedValue3) {
    console.log($w("#input1").value = checkedValue2 + ', ' + checkedValue3)
    }
 else if (checkedValue1 & checkedValue2 & checkedValue3) {
    console.log($w("#input1").value = checkedValue1 + ',' +checkedValue2 + ', ' + checkedValue3)
    }
 else {
    console.log()
    }
}

export function button5_click(event, $w) { 
    valueCombine_a();

 let word = $w("#input1").value; //Make sure to change the ID of your elements to match the code

    local.setItem("searchWord", word); //This is your search variable

    wixLocation.to(`/product`); //Change this to the URL ending of your results page  
   }

Hi,
I’d recommend you to learn the basics of javascript first, there is a lot of confusion in your code, you can check out this code about creating search functionality for your site.

Thanks Or for your suggestion.
I will study it and try to made it possible…

As I am not a programmer, the code above was copied through searching on the internet. You are Right. I made some changing on the code for trying to achieve my goal.

original code below:

   $w.onReady(function () {
    $w("#checkbox10").value = '';  //by having ' ' it makes the value equal 'nothing' when the page is loaded
    $w("#checkbox11").value = '';
    $w("#checkbox12").value = '';
    });

export function checkbox10_click() {
    iso123121();
}

export function checkbox11_click() {
    ansiz803();
}

export function checkbox12_click() {
    asNzs1067();
}


//because the page started with all the value to equal 'nothing', now we will set the values to equal the real value

function abc() {
 if ($w("#checkbox10").value === '') {
            $w("#checkbox10").value = 'abc';    
            }
 else {
                $w("#checkbox10").value = '';
            }
}

function def() {
 if ($w("#checkbox11").value === '') {
            $w("#checkbox11").value = 'def';    
            }
 else {
                $w("#checkbox11").value = '';
            }
}

function ghi() {
 if ($w("#checkbox12").value === '') {
            $w("#checkbox12").value = 'ghi';    
            }
 else {
                $w("#checkbox12").value = '';
            }
}

function valueCombine_a() {


 let checkedValue = $w("#checkbox10").value + "" + $w("#checkbox11").value + "" + $w("#checkbox12").value;
    $w("#input1").value = checkedValue;
}

export function button5_click(event, $w) { 
    valueCombine_abc();

 let word = $w("#input1").value; //Make sure to change the ID of your elements to match the code

    local.setItem("searchWord", word); //This is your search variable

    wixLocation.to(`/product`); //Change this to the URL ending of your results page  
   }