1
这里开始增量是我的HTML部分如何使用增量选项设置属性的ID,并与特定号码
<input type="text" class="demo" id="" value="" />
<input type="text" class="demo" id="" value="" />
<input type="text" class="demo" id="" value="" />
<input type="text" class="demo" id="" value="" />
<input type="text" class="demo" id="" value="" />
我的jQuery
$('.demo').attr('id', function (i) {
return 'Sample_' + (i + 1);
});
现在我需要这个“我”从开始5而不是0,所以我的结果将从Sample_6,Sample_7等开始。
我该怎么做?
没错!你是对的。 –