use*_*049 2 html variables jquery
我需要在jQuery .html()函数中打印一个var ..我该怎么做?
.html('<table><tr><td><!-- VAR PRINT HERE? --></tr></td>')
Run Code Online (Sandbox Code Playgroud)
Rei*_*eid 12
假设您的变量是在JavaScript中:
.html('<table><tr><td>' + variable_name_here + '</tr></td>')
Run Code Online (Sandbox Code Playgroud)
这简单地连接(添加,粘合在一起)第一个字符串,然后是您的变量,然后是第二个字符串.