html select optgroup
<select id="manager" name="manager" onchange="document.getElementById('hierLabelDiv').style.display = this.options[this.selectedIndex].value=='Other' ? 'block' : 'none'; document.getElementById('ownMgrElm').disabled = this.selectedIndex == 0 ? 'true' : ''; if (this.selectedIndex == 0) document.getElementById('ownMgrElm').checked = ''"> <option value="">--None--</option> <optgroup label="Standard User Fields"> <option value="Mana...
js数组排序
Array.prototype.sortBy = function (attr, rev) { return this.sort(sortByKey(attr, rev)); } var sortByKey = function (attr, rev) { //第二个参数没有传递 默认升序排列 if (rev == undefined) { rev = 1; } else { rev = (rev) ? 1 : -1; } return function (a, b) { a = a[attr].toLowerCase(); b = b[attr].toLowerCase(); if (a < b) { return rev * -1; } if (a > b) { r...