<input id="txtShoolName" type="text" style="width: 150px;" class="input" />
<select name="DropDegree" id="DropDegree" class="input" style="width: 150px;">
</select>
.....很多个HTML1.等不同的HTML,我现在能得到<input id="txtShoolName" type="text" style="width: 150px;" class="input" />或<select name="DropDegree" id="DropDegree" class="input" style="width: 150px;">
</select>的HTML
2.每个控件的HTML的ID是不一样的!所以这个ID要动态的提取
要求把id对应的加上一个i变量,这个i我已定
如:
<input id="txtShoolName2" type="text" style="width: 150px;" class="input" />
<select name="DropDegree2" id="DropDegree" class="input" style="width: 150px;">
</select>
<select name="DropDegree" id="DropDegree" class="input" style="width: 150px;">
</select>
.....很多个HTML1.等不同的HTML,我现在能得到<input id="txtShoolName" type="text" style="width: 150px;" class="input" />或<select name="DropDegree" id="DropDegree" class="input" style="width: 150px;">
</select>的HTML
2.每个控件的HTML的ID是不一样的!所以这个ID要动态的提取
要求把id对应的加上一个i变量,这个i我已定
如:
<input id="txtShoolName2" type="text" style="width: 150px;" class="input" />
<select name="DropDegree2" id="DropDegree" class="input" style="width: 150px;">
</select>
var str='<select name="DropDegree" id="DropDegree" class="input" style="width: 150px;">
</select>';
str=str.replace(/id=[\w]*/,***i);
***这个地方不知道咋写
{Regex reg = new Regex("(/id=[\w]*/");str = Regex.Replace(str, MatchE);
} public string MatchE(Match mat)
{
return mat.Groups[1].Value + 数字;
}