javascript - input name is an array of variables, how to splice it?
PHPz
PHPz 2017-05-27 17:42:39
0
1
616

$('input[name="cid[1]"]').val(data);//Assign display inventory code

This can be displayed normally, but it won't work if I modify the values ​​in the array into variables.

$('input[name="cid[$i]"]').val(data);//It cannot be displayed here

How to splice $i here?

PHPz
PHPz

学习是最好的投资!

reply all(1)
Peter_Zhu
$('input[name="cid[' + $i + ']"]').val(data);
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template