要匹配的标签如下:
<input name="rptQuestions:_ctl0:txtQuestionType" type="text" value="1" id="rptQuestions__ctl0_txtQuestionType" style="width:0px;" />
<input name="rptQuestions:_ctl0:txtQuestionTypes" type="text" value="56" id="rptQuestions__ctl0_txtQuestionTypes" style="width:0px;" />匹配整个标签,我要把字符合条件的标签删除。
其中主要以name和id中的txtQuestionType 做主要标识改怎么样写正则表达式才可以删除name和ID中存在txtQuestionType 的整个标签
<input name="rptQuestions:_ctl0:txtQuestionType" type="text" value="1" id="rptQuestions__ctl0_txtQuestionType" style="width:0px;" />
<input name="rptQuestions:_ctl0:txtQuestionTypes" type="text" value="56" id="rptQuestions__ctl0_txtQuestionTypes" style="width:0px;" />匹配整个标签,我要把字符合条件的标签删除。
其中主要以name和id中的txtQuestionType 做主要标识改怎么样写正则表达式才可以删除name和ID中存在txtQuestionType 的整个标签
解决方案 »
- svg... polyline元素如何在始末加个圆点或箭头
- 谁能解释下JavaScript自带的方法?
- 怎么在js里一个表单元素对象转化为字符串?
- 高分!!!请高手指点!!!用jvavascript在asp.net中写个新建infopath文件
- 各位大侠,我写的一个基于基数排序的脚本,排15000条数据的时候IE报错,大家看看还可以优化吗?
- 如何把参数传给新打开的窗体
- 急:如果判断<select multiple name="school[]">中的选择是不是为空
- *********************我想在点击一个超链后弹出一个窗口,并且使用窗口的最大化按钮不可用,就问如何做?****
- 从数组中随机抽取n个数据并移除数组中已被取出过的数据
- 保持this上下文环境方法,为什么要两个return
- jquery问题
- js单元测试?jquery中的 qunit是干啥的啊?
var p=/<input\s*name=".*?(?:txtQuestionType)"[^>]*>/gi;
alert(s.replace(p,''));
$("input[name^='rptQuestions'][id=^='rptQuestions']").remove();
“^=”配置以属性以给定字符串开头的元素
删除name或id包含txtQuestionType的input元素