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(博學篤志, 切問近思; 神閑氣靜, 智深勇沉.-圍爐夜話)]
          同時也希望大家幫忙.
          剛剛試了一下謝謝你.你寫的太好了.輸出后是"2,3"!
          可是我只想在把原來input值=2的哪地方輸出2,input值=3的哪地方輸出3就可以了.
          我不想要數組.只想讓他正常輸出.




          <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) 評論(0)  編輯  收藏 所屬分類: 個人記錄
          主站蜘蛛池模板: 辽宁省| 得荣县| 灯塔市| 丽江市| 阜阳市| 永定县| 建平县| 罗田县| 从江县| 杨浦区| 宜都市| 呼图壁县| 镇平县| 台山市| 布尔津县| 元朗区| 城步| 喀什市| 台江县| 宁乡县| 乐至县| 青铜峡市| 迭部县| 崇左市| 南丰县| 屏东市| 江油市| 虎林市| 于田县| 定远县| 石阡县| 上饶市| 太白县| 阿荣旗| 嵩明县| 特克斯县| 都昌县| 普兰县| 迁安市| 铜陵市| 怀化市|