html下拉框赋值自定义的code
<select class="form-control" name="items" id="productName">
<option th:each="items : ${items}"
th:value="${items.uuid}"
th:code="${items.code}"
th:text="${items.name}+'('+${items.code}+')'">
</option>
</select>
js中通过选中的option取值
$("#productName").change(function (e){
var itemCodeId = $("#productName option:selected").attr('code')
})