【发布时间】:2015-01-23 16:40:33
【问题描述】:
我只是在学习 Javascript,我们的讲师没有资格教授他一生中从未使用过任何形式的代码。我想要一个 onClick 事件来触发一个函数,它将专用表格中 3 个文本框的内容移动到一个新表格上的特定位置,以便打印。
这是包含三个文本区域的表格的代码:
<table>
<tr>
<td rowspan="2">
<textarea rows="19" cols="52"> Notes directly from the source should go in this box. (copy and paste)</textarea>
</td>
<td> <textarea rows="3" cols="30">The URL or web-address of the source should go here.</textarea>
</td>
</tr>
<tr>
<td> <textarea rows="15" cols="30">Additional notes should go in this box.</textarea>
</td>
</tr>
</table>
这个想法是将 3 段文本移动到数字记事卡上。 URL 位于顶部,直接注释位于中间,学生的注释位于底部。所有的基本格式都略有不同。这是否可以通过一个 onClick 功能实现,或者使用三个功能会更容易吗?请记住,如果我确实使用了三个函数,我需要它们都被同一个事件触发。
【问题讨论】:
标签: javascript function onclick dom-events buttonclick