将您的HTML更改为此:
<td width="30%">Do you accept Terms of Service agreement?</td>
<td width="10px" style="min-width: 10px"></td>
<td width="70%">
<input type="check@R_610_2419@" name="TOS" value="Accept" onClick="EnableSubmit(this)"> I agree to Terms of Service agreement.
</td>
原因不起作用:您没有传递任何函数。实际上,由于您没有在函数名称中使用括号,因此根本就没有调用函数。this
在onclick
HTML事件属性的上下文中传递它意味着您正在传递对该元素的DOM对象的引用,从而使您可以访问其checked
属性。