acerbic coffee
          走自己的路,讓別人跑步
          posts - 26,comments - 14,trackbacks - 0

          <textarea name=cnbruce>
          <input type="checkbox" name="checkbox" value="1" />
          <input type="text" name="text" value="2" />
          <input name="text" type="text" value="3" />
          <input type="radio" name="text" value="4" />
          <input name="text" type="hidden" value="5" />
          </textarea><button onclick=alert(pla(cnbruce.value))>alert</button>

          <script>
          ?function pla(str){
          ??re=/<input[^\>]*?type\="text"[\s\S]*?value\="(.*?)"/gi;
          ??str=str.match(re).join();
          ??re=/<input[^\<]*?value\="(.*?)"/gi;
          ??return(str.replace(re, '$1'));
          ??}
          </script>
          這里先感謝[btbtd(博學(xué)篤志, 切問(wèn)近思; 神閑氣靜, 智深勇沉.-圍爐夜話)]
          同時(shí)也希望大家?guī)兔?
          剛剛試了一下謝謝你.你寫的太好了.輸出后是"2,3"!
          可是我只想在把原來(lái)input值=2的哪地方輸出2,input值=3的哪地方輸出3就可以了.
          我不想要數(shù)組.只想讓他正常輸出.




          <textarea name=cnbruce>
          <input type="checkbox" name="checkbox" value="1" />
          <input type="text" name="text" value="2" />
          <input name="text" type="text" value="3" />
          <input type="radio" name="text" value="4" />
          <input name="text" type="hidden" value="5" />
          </textarea><button onclick=alert(pla(cnbruce.value))>alert</button>

          <script>
          ?function pla(str){
          ??re=/<input[^\>]*?type\="text"[\s\S]*?value\="(.*?)"/gi;
          ??str=str.match(re).join();
          ??re=/<input[^\<]*?value\="(.*?)"/gi;
          ??return(str.replace(re, '$1').match(/[^\,]+/ig).join(''));
          ??}
          </script>

          posted on 2006-10-25 15:08 acerbic coffee 閱讀(335) 評(píng)論(0)  編輯  收藏 所屬分類: 個(gè)人記錄
          主站蜘蛛池模板: 灵寿县| 天长市| 准格尔旗| 斗六市| 新沂市| 黄石市| 博爱县| 大城县| 宜黄县| 浦东新区| 舟曲县| 德安县| 防城港市| 台北县| 新乐市| 铁岭县| 铁岭市| 全椒县| 浠水县| 崇阳县| 海门市| 庐江县| 怀仁县| 吉隆县| 上蔡县| 黄浦区| 穆棱市| 方正县| 皮山县| 韶关市| 常熟市| 太白县| 邵东县| 阜新| 安阳县| 定襄县| 越西县| 阿勒泰市| 晋宁县| 都兰县| 勃利县|