肯定是可以的,示例:<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>Test</title>
<script language="javascript">
function SetTextValues()
{
document.form1.mytext.value="点击按钮后设置的内容";
alert("文本框内容已被改变");
}
</script>
</head><body>
<%
Dim a
a=100
If a>0 Then
%>
<form name="form1" id="form1" method="post" action="1.asp">
<input type="text" name="mytext" value="abc" />
<input name="button" type="button" id="button" value="调用Javascript" onclick="SetTextValues()"/>
</form>
<%
End If
%>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>Test</title>
<script language="javascript">
function SetTextValues()
{
document.form1.mytext.value="点击按钮后设置的内容";
alert("文本框内容已被改变");
}
</script>
</head><body>
<%
Dim a
a=100
If a>0 Then
%>
<form name="form1" id="form1" method="post" action="1.asp">
<input type="text" name="mytext" value="abc" />
<input name="button" type="button" id="button" value="调用Javascript" onclick="SetTextValues()"/>
</form>
<%
End If
%>
</body>
</html>
解决方案 »
- Permission denied to access property 'document'
- 用js改一个本地文件名
- 请问如何让一个div左右收缩或展开
- 求一javascript函数写发
- 如何用js改变鼠标图案
- 如何获取表格自定义的属性值?
- javascript 中如何实现msgbox
- 求一本JavaScript的中文电子使用手册
- 在ie关闭的时候能否延时,如何实现?
- 散分:一句javascript在IE可以但在netscape不行,如何……
- 为什么不管selectCount的值是多少,都执行openwin(winName+selectValue,winWidth,winHeight);这里
- 小算法,帮忙看看
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>Test</title>
<script language="javascript">
function SetTextValues()
{
document.form1.mytext.value="点击按钮后设置的内容";
alert("文本框内容已被改变");
}
</script>
</head><body>
<%
var a=100
if (a>0) {
%>
<form name="form1" id="form1" method="post" action="1.asp">
<input type="text" name="mytext" value="abc" />
<input name="button" type="button" id="button" value="调用Javascript" onclick="SetTextValues()"/>
</form>
<%}%>
</body>
</html>