不过到现在,好象还没专门的Javascript调试环境
还好Mozilla里面带了个,昨天刚下载的,感觉还不错
<
html
>
< head >
</ head >
< script language = " javascript " >
function Check()
{
if (form1.tbx1.value.length < 1 )
{
alert( " 姓名不能为空! " , " 警告 " );
return false ;
}
if (form1.tbx2.value.length < 1 )
{
alert( " 密码不能为空! " , " 警告 " );
return false ;
}
var sum = eval(form1.tbx1.value + form1.tbx2.value);
alert(sum, " 警告 " );
}
function input(select)
{
if (select == 1 )
{
form1.tbx1.value = prompt( " input first one number: " , "" );
return false ;
}
form1.tbx2.value = prompt( " input second one number: " , "" );
return false ;
}
</ script >
< body >
< form method = " POST " name = " form1 " >
< p >
姓名: < input type = " text " name = " tbx1 " size = " 20 " onFocus = " input(1) " >
密码: < input type = " text " name = " tbx2 " size = " 20 " onFocus = " input(2) " ></ p >
< p >< input type = " button " value = " 提交 " name = " btn1 " onClick = " Check() " >& nbsp; & nbsp; & nbsp; & nbsp; & nbsp;
< input type = " button " value = " 重置 " name = " Btn2 " ></ p >
</ form >
< br >
< script language = " javascript " >
// alert("这是我的第一个测试!","呵呵");
document.writeln( " it works <br> " + " and I love it " );
// var colors = prompt("输入您需要的颜色:","#ff00ff");
// document.write("您选择的颜色是:<font color=#ff00ff>"+colors+"</font>");
</ script >
</ body >
</ html >
< head >
</ head >
< script language = " javascript " >
function Check()
{
if (form1.tbx1.value.length < 1 )
{
alert( " 姓名不能为空! " , " 警告 " );
return false ;
}
if (form1.tbx2.value.length < 1 )
{
alert( " 密码不能为空! " , " 警告 " );
return false ;
}
var sum = eval(form1.tbx1.value + form1.tbx2.value);
alert(sum, " 警告 " );
}
function input(select)
{
if (select == 1 )
{
form1.tbx1.value = prompt( " input first one number: " , "" );
return false ;
}
form1.tbx2.value = prompt( " input second one number: " , "" );
return false ;
}
</ script >
< body >
< form method = " POST " name = " form1 " >
< p >
姓名: < input type = " text " name = " tbx1 " size = " 20 " onFocus = " input(1) " >
密码: < input type = " text " name = " tbx2 " size = " 20 " onFocus = " input(2) " ></ p >
< p >< input type = " button " value = " 提交 " name = " btn1 " onClick = " Check() " >& nbsp; & nbsp; & nbsp; & nbsp; & nbsp;
< input type = " button " value = " 重置 " name = " Btn2 " ></ p >
</ form >
< br >
< script language = " javascript " >
// alert("这是我的第一个测试!","呵呵");
document.writeln( " it works <br> " + " and I love it " );
// var colors = prompt("输入您需要的颜色:","#ff00ff");
// document.write("您选择的颜色是:<font color=#ff00ff>"+colors+"</font>");
</ script >
</ body >
</ html >