[英]how do I concatenate a variable and string to show an image?
I have a variable stored in localStorage from a button click. 我通过单击按钮将变量存储在localStorage中。 How do I display an image that has the same name as the variable + .png using jQuery?
如何使用jQuery显示与变量+ .png同名的图像? I can't seem to get the right syntax...I'm very new to this and I appreciate any help!!!
我似乎无法获得正确的语法...我对此很陌生,感谢您的帮助!!!
You are missing some brackets. 您缺少一些括号。 Try
尝试
"<div><img src=\"images" + adj1 + ".png\" ></div>"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.