我想手动调用复选框的 onClick 方法,因为我根据特定条件将复选框显示为“已选中”。
下面是我的代码
if(in_array($rs['item_number'],$it_arr))
echo "<td><span class='data'>-</span><input type=checkbox onclick=\"AddItemRow(this)\" checked/></td>";
else
echo "<td><span class='data'>-</span><input type=checkbox onclick=\"AddItemRow(this)\" /></td>";
在上面的代码中,我想调用 AddItemRow(this) 方法,并且还想传递该方法接受的变量 this 。我该怎么做?