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