So I am trying to make a string out of a string and a passed variable(which is a number).(所以我试图用字符串和传递的变量(这是一个数字)来创建一个字符串。)
How do I do that?(我怎么做?)
I have something like this:(我有这样的事情:)
function AddBorder(id){
document.getElementById('horseThumb_'+id).className='hand positionLeft'
}
So how do I get that 'horseThumb' and an id into one string?(那么如何将'horseThumb'和id变成一个字符串呢?)
I tried all the various options, I also googled and besides learning that I can insert a variable in string like this getElementById("horseThumb_{$id}")
<-- (didn't work for me, I don't know why) I found nothing useful.(我尝试了各种各样的选项,我也google了,除了学习我可以在字符串中插入一个变量,如getElementById("horseThumb_{$id}")
< - (对我来说不起作用,我不知道为什么)我发现没什么用处。) So any help would be very appreciated.(所以任何帮助都将非常感激。)
ask by necker translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…