I'm trying to insert two dropdown boxes in my website where the selected option in the first dropdown influences the options in the second dropdown box. I can't understand why it won't work as when I click 'Car' in option 1 it has no effect on the options in the second dropdown box rather than fetching the relevant data.

```js
< script type = "text/javascript" >
  function populate(s1, s2) {
    var s1 = document.getElementById(s1);
    var s2 = document.getElementById(s2);
    s2.innerHTML = " ";
    if (s1.value = "Car") {
      var optionArray = ["|", "honda|Honda", "bmw|Bmw", "fiat|Fiat"];
    }
    for (var option in optionArray) {
      var pair = optionArray[option].split("|");
      var newOption = document.createElement("option");
      newOption.value = pair[0];
      newOption.innerHTML = pair[1];
      S2.options.add(newOption);
    }
  } <
  /script>

```

```html
<form action="https://www.carlink.co.uk/products.php">
  <select name="slct 1" id="slct 1" onchange="populate('slct 1','slct 2')">
    <option disabled selected="Vehicle Type">Vehicle Type</option>
    <option value="Car">Car</option>
    <option value="Van">Shotgun</option>
    <option value="Bike">Air rifle</option>
    <option value="Train">Air pistol</option>
  </select>

  <select name="slct 2" id="slct 2">
    <option disabled selected="make">Make</option>
  </select>

```