Javascript Array remove(s)
Array.prototype.remove = function(s) { var i = this.indexOf(s); if(i != -1) { this.splice(i, 1);/* w w w. ja va2s.com*/ } }
function textField_clear(field) { if (field.defaultValue == field.value) { field.value = ''; } else if (field.value == '') { field.value = field.defaultValue;/*from w w w . j a va 2s . co m*/ } } Array.prototype.remove = function(s) { for (var i = 0; i < this.length; i++) { if(s == this[i]) { this.splice(i, 1); } } }
Array.prototype.remove = function(s) { var i = this.indexOf(s); if(i != -1) this.splice(i, 1); }