JS根据TYPE设置页面所有radio的选择值 获取自定义属性

//一键正常
        function benSetState() {
            $(function () {
                $('input[type=radio]').each(function () {
                    if ($(this).val() == "1") {
                        $(this).attr('checked','true');
                    }
                })
            })
        }


<td align="center"><input type="radio" checked="checked"  name="rdState1" value="1" />正常 <input type="radio"  name="rdState2" value="2" />损毁 </td>
 //根据type获取控件所有hidden
 function fGetControlByType() {
     $('input[cuvaluetrantype=ewebedittype]').each(function () {
         var valueValue = $(this).attr('cuvaluetrantype'); //获取自定义属性
         var ewebeditID = $(this).attr('id').substring(3, $(this).attr('id').length); //截取组合ID字段
         var eWebditor1 = window.frames("eWebEditor" + ewebeditID).window.frames('eWebEditor').document.getElementsByTagName('body')[0].innerHTML; //获取ewebeditor值
         $(this).val(eWebditor1);//给隐藏控件赋值
     })
 }
原文地址:https://www.cnblogs.com/zecVip/p/4515438.html