<select id="order_selects" name="" class="form-control">
<option selected disabled><?php echo $_LNG['TYPE_ORDER']; ?></option>
<option value="select_all"> <?php echo $_LNG['ALL_TYPES']; ?> </option>
<option value="select_domain"> <?php echo $_LNG['DOMAIN']; ?> </option>
<option value="select_server"> <?php echo $_LNG['SERVER']; ?> </option>
<option value="select_ssl"> <?php echo $_LNG['SSL']; ?> </option>
<option value="select_desing"> <?php echo $_LNG['DESING']; ?> </option>
<option value="select_script"> <?php echo $_LNG['SCRIPT']; ?> </option>
<option value="select_layout"> <?php echo $_LNG['LAYOUT']; ?> </option>
<option value="select_adv"> <?php echo $_LNG['ADV']; ?> </option>
<option value="select_seo"> <?php echo $_LNG['SEO']; ?> </option>
</select>
$options = [
[null, $_LNG['TYPE_ORDER']],
['select_all', $_LNG['ALL_TYPES']],
['select_domain', $_LNG['DOMAIN']],
['select_server', $_LNG['SERVER']],
['select_ssl', $_LNG['SSL']],
['select_desing', $_LNG['DESING']],
['select_script', $_LNG['SCRIPT']],
['select_layout', $_LNG['LAYOUT']],
['select_adv', $_LNG['ADV']],
['select_seo', $_LNG['SEO']],
];
printf('const options = %s;', json_encode($options));
options
полноценный элемент select
со всеми опциями: createSelect = () => {
const select = document.createElement('select');
options.forEach(([value, title]) => {
const option = document.createElement('option');
option.innerText = title;
if (value) {
option.value = value;
} else {
option.setAttribute('disabled', true);
option.setAttribute('selected', true);
}
select.appendChild(option);
});
return select;
};