vbscript实现javascript “this” 的功能
其实就是用me来代替this,不多说,看代码:
=============================
代码1:
<html>
<head>
<title>无标题文档</title>
</head>
<body>
<input id="testit" type=button value="测试" onclick="vbscript:me.value='完成'">
<input id="testit" type=button value="测试" onclick="javascript:this.value='完成'">
</body>
</html>
=====================
代码2:
<html>
<head>
<title>无标题文档</title>
<script language=vbscript>
sub change(objid)
objid.value="完成"
end sub
</script>
</head>
<body>
<input id="testit" type=button value="测试" onclick="change(me)">
</body>
</html>
=======================
相关文档:
js验证表单大全
1. 长度限制
<script>
function test()
{
if(document.a.b.value.length>50)
{
alert("不能超过50个字符!");
document.a.b.focus();
return false;
}
}
</script>
<form name=a onsubmit="return test()">
<textarea name="b" cols="40" wrap="VIRTUAL" rows="6"&g ......
在ie6中对于<input type="file"
/>通过obj.value是可以获取客户端选择文件的全路径的,但是到ie7就只能获取文件名,这对于onchange事件立即显示图片会有问题,可以用js方法解决
具体代码如下:
<html>
<head>
< ......
14 分割字符串
1: <script language=”JavaScript”>
2: <!--
3: var myVariable = “a,b,c,d”;
4: var stringArray = myVariable.split(“,”);
5: document.write(stringArray[0]);
6: document.write(stringArra ......
//各种尺寸
s += "\r\n网页可见区域宽:"+ document.body.clientWidth;
s += "\r\n网页可见区域高:"+ document.body.clientHeight;
s += "\r\n网页可见区域高:"+ document.body.offsetWeight +" (包括边线的宽)";
s += "\r\n网页可见区域高:"+ document.body.offsetHeight +" ......
// 浏览器显示区域的宽和高,向下还原后值会变小。
document.body.clientWidth;
document.body.clientHeight;
// 与上面的两个值相比,我觉得就是加上了滚动条的宽和高
document.body.offsetWidth;
document.body.offsetHeight;
// 整个网页的高度和宽度,包括滚动条中没有显示出来的
document.bod ......