thymeleaf怎么把th:each的对象传给jquery?

在用thymeleaf+layui时遇到个问题,代码如下:

```

th:each="device : ${devices}"
th:text="${ '编号:' + device.deviceSerial + '      设备名:' + device.deviceName}"
th:attr="value=${device}">

layui.use(['form', 'layer', 'element'], function () {
var form = layui.form;
form.on('select(sxt)', function (data) {
console.log(JSON.stringify(data.value));
});```

我想在jQuery中拿到对象device,并且获取device中的属性值,但是打印出来的时device的地址字符串,这是什么原因,怎样才能获取触发事件时的那个对象?

var device = $("#device option:selected").val();