我觉的这样更有人机交互感:
function rec(){
var score; //score变量,用来存储用户输入的成绩值。
score = prompt("请输入你的成绩") ;
if(score>=90)
{
alert("你很棒!");
}
else if(score>=75)
{
alert("不错吆!");
}
else if(score>=60)
{ alert("要加油!");
}
else
{
alert("要努力了!");
虽然只是在学习,但是看着更舒服。
function rec(){
var score; //score变量,用来存储用户输入的成绩值。
score = prompt("请输入你的成绩") ;
if(score>=90)
{
alert("你很棒!");
}
else if(score>=75)
{
alert("不错吆!");
}
else if(score>=60)
{ alert("要加油!");
}
else
{
alert("要努力了!");
虽然只是在学习,但是看着更舒服。
2016-08-20
function Wopen(){
var message=confirm(是否打开新窗口)// 新窗口打开时弹出确认框,是否打开
if(var message=true)
window.write=open window('http://www.imooc.com/','width=400,heigh=500,menubar=no,toolar=no')
else()
openwindow.close;
}
var message=confirm(是否打开新窗口)// 新窗口打开时弹出确认框,是否打开
if(var message=true)
window.write=open window('http://www.imooc.com/','width=400,heigh=500,menubar=no,toolar=no')
else()
openwindow.close;
}
最新回答 / 天街小宇
<form> <!--当点击相应按钮,执行相应操作,为按钮添加相应事件--> <input type="button" value="改变颜色" onclick="changecolor()"> <input type="button" value="改变宽高" onclick="changewh()"> <input type="button" value="隐藏内容" onclick="hide()"> &l...
2016-08-20
//定义"取消设置"的函数
function none(){
var a=document.getElementById("txt");
var b=confirm("点击确定取消设置");
if(b==true){
a.style.display="block";
a.style.color="";
a.style.height="400px";
a.style.width="600px";
}
}
function none(){
var a=document.getElementById("txt");
var b=confirm("点击确定取消设置");
if(b==true){
a.style.display="block";
a.style.color="";
a.style.height="400px";
a.style.width="600px";
}
}
//定义"改变颜色"的函数
function changcolor(){
var a=document.getElementById("txt");
a.style.color="red";
}
//定义"改变宽高"的函数
function changwidth(){
var a=document.getElementById("txt");
a.style.height="300px";
a.style.width="450px";
}
function changcolor(){
var a=document.getElementById("txt");
a.style.color="red";
}
//定义"改变宽高"的函数
function changwidth(){
var a=document.getElementById("txt");
a.style.height="300px";
a.style.width="450px";
}