<input type="hidden" id="selectrole" th:value="${users.role}">
<select name="role" id="selects">
<option >请选择</option>
<option value="1">1</option>
<option value="2">2</option>
</select>
<script>
$(document).ready(function(){
//获取后台数据的值(隐藏输入框的值)
var key=$("#selectrole").val();
//根据值让option选中
$("#selects option[value='"+key+"']").attr("selected","selected");
})
</script>