Hello I wrote code to remove 2 option values if d is equal to something
var d = document.getElementById("random").value
if(d == "A600")
$("#randomtype option[value='aosp'],#randomtype option[value='oneui']").remove();
It removes it even if d is not equal to A600. How come?
var d = document.getElementById("random").value
if (d == "A600")
$("#randomtype option[value='aosp'],#randomtype option[value='oneui']").remove();
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<select id="random" name="random">
<option value="negative">Model</option>
<option value="J710">J710X</option>
<option value="J701">J701X</option>
<option value="A320">A320X</option>
<option value="G610">G610X</option>
<option value="J600">J600X</option>
<option value="A600">A600X</option>
<option value="J737">J737X</option>
<option value="M105">M105X</option>
</select>
<select id="randomtype" name="randomtype">
<option value="negative">Variant</option>
<option value="oneui">OneUI Non Treble</option>
<option value="oneuit">OneUI Treble</option>
<option value="aosp">AOSP Non treble</option>
<option value="aospt">AOSP Treble</option>
</select>
Now it doesnt remove it at all hmm