摘要: <html> <head> </head> <script> function demo(){var namevalue = document.getElementsByName("user");for(var i=0;i<namevalue.length;i++){ var value1 = namevalue[i].nextSibling.nodeValue; if(namevalue[i].checked){ alert(value1); } }}</script> <body> <i 阅读全文
posted @ 2012-07-04 15:02 cove 阅读(498) 评论(0) 推荐(0)
摘要: 引用自百度知道里面的一个问答例如数组{1,2,3,4,5}要把数组里面的3删除得到{1,2,4,5}js代码:<script type="text/javascript"> Array.pArray.prototype.indexOf = function(val) { //prototype 给数组添加属性 for (var i = 0; i < this.length; i++) { //this是指向数组,this.length指的数组类元素的数量 if (this[i] == val) return i; //数组中元素等于传入的参数,i是下标,如 阅读全文
posted @ 2012-07-04 14:59 cove 阅读(236) 评论(0) 推荐(0)