【发布时间】:2016-05-02 10:05:58
【问题描述】:
我正在处理 jsp 页面。这里我需要在按钮单击时添加文本字段。
我无法编写 java 脚本函数来在按钮单击时添加 textField。
<body>
<button type="button">Add more !</button>
<table id="customers">
<tr>
<th>Product</th>
<th>Quantity</th>
<th>Price</th>
</tr>
<tr>
<td><input type="text" name="product" value="product.."></input></td>
<td><input type="number" name="quantity" value="quanty.."></input></td>
<td><input type="number" name="price" value="price.."></input></td>
</tr>
// i want to add these fields dynamically on button click.
</table>
</body>
【问题讨论】:
-
你开始使用 JavaScript 了吗?
-
@VinothKrishnan 我已经尝试过了。但确实,在我的情况下不起作用。
标签: javascript java jquery jsp