【发布时间】:2011-07-15 23:57:28
【问题描述】:
JavaScript 有什么方法可以通过单击按钮生成字段集中的所有元素?下面的代码显示了一个字段集中的两个文本框和一个文本区域。当我按下“添加项目按钮”时,我想在该字段集中生成相同的文本框和文本区域。
非常感谢您的帮助。
<fieldset id="fieldset">
<legend id="legend">Professional development</legend>
<p>Item <input type ="text" size="25" name="prof_item" /><br /></p>
<p>Duration <input type ="text" size="25" name="prof_duration" /><br /></p>
<p>Enlargement <label for="enlargement"></label><p></p>
<textarea name="textarea" cols="71" rows="5" id="prof_enlargement">
</textarea></p>
<p><input type="submit" name="Submit" value="Add new item" id="add_prof" /></p>
</fieldset>
【问题讨论】:
标签: javascript