<script language=javascript>
str="<input type=text name=sdsd size=8 value=sad style=width:100%; onKeyUp=if(isNaN(this.value))this.value='';workCount(searchByTagName(this,'tr').rowIndex);>"
re=/(<input)(.+?)\svalue=(.+?)([\s>])/g
alert(str.replace(re,"$1$2$4"))
</script>
str="<input type=text name=sdsd size=8 value=sad style=width:100%; onKeyUp=if(isNaN(this.value))this.value='';workCount(searchByTagName(this,'tr').rowIndex);>"
re=/(<input)(.+?)\svalue=(.+?)([\s>])/g
alert(str.replace(re,"$1$2$4"))
</script>
解决方案 »
- 求助,innerHTML
- IE在加载网页执行window.onload()时候无法设置innerHTML 但FF可以
- 一个javascript,"事件"语法问题?
- 请帮忙看看jquery代码有什么问题
- 到底都是什么意思啊?
- 如何保存一段 javascript脚本 为一个javascript 对象 (急,在线等)
- ■■请教:如何控制TABLE中的某列数据隐藏和显示,请看例子:■■
- 高分求教!关于网页打印时动态页面设置的问题!
- 能否通过javascript将页面另存到本地的,即实现IE"文件"菜单中的"另存为"功能?
- 文本框隐藏问题
- 求javascript replace的详细帮助文档
- window.open()如何控制父页面
<!--
var r = /\bvalue\s*=\s*(\'|\"|)[^\'\"\s]+\1/gi
var str="<input type=text name=fixItem size=15 value=fdsa style=width:100%;>"
alert(str.replace(r, "value=''"));
var str="<input type=text name=sdsd size=8 value=sad style=width:100%; onKeyUp=if(isNaN(this.value))this.value='';workCount(searchByTagName(this,'tr').rowIndex);>"
alert(str.replace(r, "value=''"));
//-->
</SCRIPT>
<script language=javascript>
str="<input type=text name=sdsd size=8 value=sad style=width:100%; onKeyUp=if(isNaN(this.value))this.value='asd';workCount(searchByTagName(this,'tr').rowIndex);>"
re=/(<input)(.+?)\svalue=(.+?)([\s>])/g
alert(str.replace(re,"$1$2 value='' $4"))
</script>