1.方法一 <input type="checkbox" onclick="checkboxOnclick(this)" /> <script> function checkboxOnclick(checkbox){ if ( checkbox.checked == true){ //Action for checked }else{ //Action for not checked } } 2.方法二 $('#allSelect').cli
我们在用到下拉列表框select时,需要对选中的<option>选项触发事件,其实<option>本身没有触发事件方法,我们只有在select里的onchange方法里触发. 当我们触发select的双击事件时,用ondblclick方法.当我们要取得select的选中事件时,用document.all['name'].value来获取,其中name是select的名称.如果我们要得到select的全部的值就用一个for循环来实现.代码如下: var vi = document.a
window.event只能在IE下运行,不能在firefox下运行,这是因为firefox的event只能在事件发生的现场使用. 在firefox里直接调用event对象会报undefined.兼容解决方式: <input type="text" onkeydown="keyup_submit(event);"> <script> function keyup_submit(e){ var evt = window.event || e
在编辑屏幕的PAI的时候,对字段的检查一般用field xxx module xxx或者用chain.有两种操作可供选择,一种是on input,另一种是on request. 区别是: on input的触发条件是:只要该字段不为空就会触发module on request的触发条件是:该字段发生变化后触发module 例如,有两个字段,a.b,两个module,check_a check_b: field a module check_a on input. field b module c