treeview单选js

        //单选
        function OnTreeNodeCheckedOnlyOne() {
            var element = window.event.srcElement;
            if (element.checked) {
                tv = document.getElementById("TreeView1");
                es = tv.getElementsByTagName("input");
                for (var i = 0; i < es.length; i++) {
                    if (es[i].id != element.id) {
                        es[i].checked = false;
                    }

                }
            }
            var LeftTreeCheck = document.getElementById("LeftTreeCheck");
            if (LeftTreeCheck != null)
                LeftTreeCheck.click();
        }

 

 

 

 

TreeView1.Attributes.Add("onclick", "OnTreeNodeCheckedOnlyOne()");

你可能感兴趣的:(function,null,input)