Reputation: 2134
I am trying to do this.
$("#slot_+num option[value='8']").remove();
if I do this
$("#slot_0 option[value='8']").remove();
It works, but if I try to set the selector dynamically with variable num it doesn't do anything.
Upvotes: 2
Views: 74
Reputation: 13599
You need to concatenate the string, like this:
$("#slot_"+num+" option[value='8']").remove();
Upvotes: 2