android 单选按钮对号,用“对号”和“叉号”代替单选框和复选框选中或未选中代码详解...

用“对号”和“叉号”代替单选框和复选框选中或未选中代码,使用javascript+css可以实现这样的操作!

效果如图:

a4c26d1e5885305701be709a3d33442f.png

/p>

Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

/>

/>

/>

Free图库网-BIR - Boolean Input

Replacement Sample

crir = { init: function() { arrLabels = document.getElementsByTagName_r('label');

searchLabels: for (var i=0; i

{ // get the input element based on the for attribute of the label

tag if (arrLabels[i].getAttributeNode('for')

&&

arrLabels[i].getAttributeNode('for').value != '')

{ labelElementFor =

arrLabels[i].getAttributeNode('for').value; inputElement =

document.getElementByIdx_x_x(labelElementFor); } else { continue searchLabels; }

inputElementClass = inputElement.className;

// if the input is specified to be hidden intiate

it if (inputElementClass == 'crirHiddenJS')

{ inputElement.className = &

你可能感兴趣的:(android,单选按钮对号)