Thymeleaf onclick将td值发送到javascript函数

Gur*_* Mb 2 html javascript java jquery thymeleaf

我正在使用"Thymeleaf",我想将值发送到javascript,我是新手,我正在尝试下面的代码:

onclick="getPropId('${properties.id}')"
Run Code Online (Sandbox Code Playgroud)

和功能

getPropId(inputID){alert(inputId);}
Run Code Online (Sandbox Code Playgroud)

但我没有获得实际价值.

Gur*_* Mb 7

上面的问题现在解决了,我们需要使用Thymeleaf特定的语法.

th:onclick="'getPropId(\'' + ${properties.id} + '\');'"
Run Code Online (Sandbox Code Playgroud)

现在如果它在javascript函数中显示正确的properties.id.

function getPropId(inputID){
    alert(inputID);
}                           
Run Code Online (Sandbox Code Playgroud)