I have overridden this below file
vendor/magento/module-configurable-product/view/frontend/templates/product/view/type/options/configurable.phtml
I’m trying to add an appropriate simple product id to its options.
<div class="control">
<select name="super_attribute[<?= $block->escapeHtmlAttr($_attribute->getAttributeId()) ?>]"
data-selector="super_attribute[<?= $block->escapeHtmlAttr($_attribute->getAttributeId()) ?>]"
data-validate="{required:true}"
id="attribute<?= $block->escapeHtmlAttr($_attribute->getAttributeId()) ?>"
class="super-attribute-select">
<option value=""><?= $block->escapeHtml(__('Choose an Option...')) ?></option>
</select>
</div>
For example:
<select name="super_attribute[93]" data-validate="{required:true}" id="attribute93" class="super-attribute-select"
onchange="changeAttr(this)" aria-required="true">
<option data-product-id="30" value="">Choose an Option...</option>
<option data-product-id="31" value="5448">Yellow +$3.52</option>
<option data-product-id="32" value="5459">White +$3.52</option>
<option data-product-id="32" value="5461">Orange +$3.52</option>
</select>