我有一个表单和一个按钮来添加它的副本.我希望重复的无线电输入具有变量名

I have a form and a button to add duplicates of it. I want the duplicate radio inputs to have variable names

本文关键字:我希望 副本 无线电 变量名 输入 添加 表单 有一个 按钮 一个      更新时间:2023-09-26

我有一个'count'变量在我的javascript每次增加一个新的形式。目前,我正在尝试这个:

count=1;
function newForm(){
...<input name=""check"+count" type="radio" value="Website" />...
}

但是,很明显这是行不通的

不能在'(单引号)

中使用"引号"(双引号)

改为

<input name='"check'+count+'"' type="radio" value="Website" />
相关文章: