肯定是可以的,示例:<%@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>

解决方案 »

  1.   

    ASP(JAVASCRIPT)示例:<%@LANGUAGE="JAVASCRIPT" 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>
    <% 
    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>