Javascript 中的三目运算
html:
<input id="only1302_checkBox" fieldname="tzActionID0020" operation="like" value="" type="checkbox" checked="true" />
js:
1 2 /* 3 * 仅闯红灯开关(checkBox) 4 * = = = = = = = = = = = 5 * 默认状态:已选择 6 * 默认值: 1302 7 * 该控件位于: js/commons.js 8 * 2013-06-05 Livon 9 */ 10 var dom = Efs.getDom('only1302_checkBox') ; 11 if(dom) dom.value = dom.checked?'1302':'' ; 12 // ( dom.checked )? dom.value = '1302' : dom.value = '' ; 13 // if( dom.checked ) dom.value = '1302' ; else dom.value = '' ;