i am trying to write a dynamic dropdown menu, if the selected item in the first dropdown menu end with the letter s then the user can select all items in the second dropdown menu if it doesn't end buy the letter s he can only see the red color in the second menu. can anyone help me with this problem
<select class=form-control name="items" id="items" data-child="itemschild">
<option selected disabled>Items</option>
<option value="Vips">Vips</option>
<option value="Superstars">superstars</option>
<option value="chief">chief</option>
<option value="employer">employer</option>
</select>
<select class=form-control name="itemschild" id="itemchild">
<option data-group='SHOW' value='0'>-- Select --</option>
<option data-group="xxxxx" value="green">green</option>
<option data-group="xxxxxx" value="yellow">yellow</option>
<option data-group="xxxxxx" value="blue">blue</option>
<option data-group="xxxxx" value="red">red</option>
</select>