I have this select
and it has a change event bound to it. On the change
of the value inside it, I want to select a particular element in another select list i.e. a particular option in that.
However it doesn't work. There are some services in Main services upon whose selection the subservice is not required hence the default -select-
should be selected.
$("#MainServices").change(function() {
$(#SubServices).val("-Select-")
}
<select class="d-flex flex-wrap" name="MainServiceName" id="MainServices">
<option selected value="m-None">-Select-</option>
<option value="m-SS">Software Services</option>
<option value="m-AIMS">Asset Integrity Management Services</option>
<option value="m-HSE">HSE & Environmental Services</option>
<option value="m-ES">Engineering Services</option>
</select>
<select class="d-flex flex-wrap" name="SubServiceName" id="SubServices">
<option class="" selected value="s-None">-Select-</option>
<option class="SoftwareServices" value="s-AIMS">VAIL-Plant (Asset Integrity Management System)</option>
<option class="SoftwareServices" value="s-PHA">VAIL-PHA (Process Hazard Analysis)</option>
<option class="SoftwareServices" value="s-PSRA">VAIL-PSRA (Petrol Station Risk Assessment)</option>
<option class="SoftwareServices" value="s-MTS">VAIL-MTS (Material Tracking System)</option>
</select>