html
<tr>
<td class="label">请选择平台名称</td>
<td>
<select name="channel_sn" id="channel_sn" onchange="createOrderSn(this)">
<option value="0">请选择平台名称</option>
{foreach from=$platform item=item k=k}
<option value="{$item.platform_id}" >{$item.platform_name}</option>
<option hidden="hidden" id="platform_code" value="{$item.platform_code}">{$item.platform_code}</option>
{/foreach}
</select>
</td>
</tr>
HTML
js
<script>
var sel=document.getElementById("channel_sn");
console.log(sel);
var index = sel.selectedIndex; // 选中索引
console.log(index);
var enCode = $(sel.options[index]).attr('en');
//获取平台code
var code = sel.options[index+1].value;
console.log(code);
</script>
效果