【发布时间】:2009-08-18 05:49:29
【问题描述】:
有谁知道如何用 Javascript 替换 html 中的传递变量?
例子:
如果我有如下代码:
<table width="150" border="0" cellspacing="0" cellpadding="2" id="productBox">
<tr>
<td valign="top" height="19" id="td4"><img onclick="addNewRowToTable('abc')" src="images/add0.gif" onmouseover="this.src=\'images/add1.gif\'" onmouseout="this.src=\'images/add0.gif\'" class="handCursor" width="49" height="19"></td>
</tr>
</table>
我可以用javascript将变量“abc”替换为“cde”吗?
【问题讨论】:
-
为什么不把cde传给函数呢?
标签: javascript