I'm using trying to output options for products in a select dropdown, I'll just include the HTML here:
<div class="form-group">
<label for="optSel">Select Option:</label>
<select class="form-control" id="optSel">
<option selected>Default</option>
<option>Kobalt Battery:$<span id='optPrc_1'>20.00</span></option>
</select>
</div>
Actual output on web page after viewing source is the same except the spans are gone. Visually it looks the same. I need to give that price an ID as it is going to be used to calculate the total cost of a product later.
The id for the span and the value inside of it are output by a PHP script, but that's irrelevant to this problem. Am I not able to use spans in options? Are there no other tags compatible with option? If not I'll have to resort to using regex with using jQuery when I calculate the total.
I'm using a 64 bit WAMP server running PHP 7.0.4 and Apache 2.4.18. I'm also using bootsrap. My question is similar to This one but they're not the same. Thanks.