有誰知道我該如何用Javascript替換html中的傳遞變量?任何我可以用javascript代替函數變量的方式?
實施例:
如果我有如下代碼:
<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傳遞給函數? – rahul 2009-08-18 05:51:02