0
的價值,我有一些投入這樣寫的按鈕:使用正則表達式在我的頁面獲取輸入
<input type="button" value="" idtag="" style="color:rgb(51, 156, 203); background-color:white; border:0px; padding:0px;">
我可以使用正則表達式來獲得的價值和IDTAG的價值?並且在方法替換之後,替換字符串上的結果?
text = text.replace(/(<input type="button" value="(.+)" idtag="(.+)" style="color:rgb(51, 156, 203); background-color:white; border:0px; padding:0px;">)/gi, function($0,$1,$2){return $3+"-"+$4;});
謝謝
我可以使用此解決方案,如果輸入的代碼包含內部的其他HTML代碼? – Mark116 2013-02-12 10:24:46
你是什麼意思?如果它被包含爲數據而不是HTML? – epoch 2013-02-12 13:14:47