【发布时间】:2013-05-05 06:22:51
【问题描述】:
我想转换这个:
<html>
s
<RB:Block_Left>sss</RB:Block_Left>
s
hello
</html>
到这里,
<html>
s
s
hello
</html>
而且这段代码必须在文本区域中,我做到了,但不能工作!
<textarea id ="code">
<html>
s
<RB:Block_Left>sss</RB:Block_Left>
s
hello
</html>
</textarea>
<br />
<input type="button" value="makeit!" onclick="ARAS()" />
<br />
<textarea id ="newcode">
</textarea>
<script>
function ARAS(){
str=document.getElementById('code').value;
str=str.substring( + str.indexOf('<html>') - str.indexOf('<\/RB:Block_Left>') + str.indexOf('<\/RB:Block_Left>'));
document.getElementById('newcode').value=str;
}
</script>
【问题讨论】:
标签: javascript substring indexof