web二级综合应用题(过滤空格)

1.表格边框初始颜色为红色,宽度为1px,其颜色每隔500毫秒在红色与蓝色之间变换
2.在文本框中输入带空格的字符串,点击过滤按钮会将字符串中含有的空格过滤掉。

 

 

<html>
<head>
<title>自动过滤文本框空格</title>
<style>
 /* ********FOUND********* */
td {border:1px  solid  red}
.example {border:5px  solid  yellow}
</style>
<SCRIPT>
function ignoreSpaces(string) {
var temp = "";
string = '' + string;
 /* ********FOUND********* */
splitstring = string.split(" ");
 /* ********FOUND********* */
for(i = 0; i < splitstring.length; i++)
temp += splitstring[i];
return temp;
}
function  flashit(){  
 /* ********FOUND********* */  
if  (myexample.style.borderColor=="blue")    
 /* ********FOUND********* */
myexample.style.borderColor="red"    
else    
 /* ********FOUND********* */
myexample.style.borderColor="blue"    
}    
</script>
</head>
<body>
<table class="example" align="center"  width="261"  id="myexample">    
<tr>
<td>
<font size="2">在此输入几个带空格的字符串:</font>. 
  <form>
<input type=text size=33 onBlur="this.value=ignoreSpaces(this.value);">
<input type=button value="过滤">
</form>
</td>
</tr>
</table>
<script > 
<!-- **********Found********** --> 
setTimeout("flashit()",  500)       
</script> 
</body>
</html>

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值