var duanwei=prompt("你是大神嗎?告訴我你的隱藏分數");
if(duanwei>=2200)
{
document.write("大神,請收下我的膝蓋!");
}
else if(duanwei>=1600)
{
document.write("哎呦,不錯哦,你可以在白金鉆石掌控雷電了!");
}
else
{
document.write("你活著的意義?說出你的故事!");
}
if(duanwei>=2200)
{
document.write("大神,請收下我的膝蓋!");
}
else if(duanwei>=1600)
{
document.write("哎呦,不錯哦,你可以在白金鉆石掌控雷電了!");
}
else
{
document.write("你活著的意義?說出你的故事!");
}
2015-11-12
document.write("hello");
document.write(" ");
document.write("world");
這樣輸入就會執行出“hello world”,document.write("hello world");也可以
document.write(" ");
document.write("world");
這樣輸入就會執行出“hello world”,document.write("hello world");也可以
2015-11-12
function openWindow(){
var myshar =confirm("是否打開?");
if(myshar==true){
var mypro=prompt("輸入要打開的網址")
if(mypro!=null){
window.open("http://www.xianlaiwan.cn/","-blank","width=400,height=500,toolbar=no,menubar=no")
}
}
}
var myshar =confirm("是否打開?");
if(myshar==true){
var mypro=prompt("輸入要打開的網址")
if(mypro!=null){
window.open("http://www.xianlaiwan.cn/","-blank","width=400,height=500,toolbar=no,menubar=no")
}
}
}
ddd<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>引用JS文件</title>
<script src="script.js"></script>
</head>
<body>
</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>引用JS文件</title>
<script src="script.js"></script>
</head>
<body>
</body>
</html>
2015-11-11
window.open("http://www.xianlaiwan.cn","_blank","width=600,height=400,top=100px,left=0,status=no,scrollbars=yes")
2015-11-11
<script type="text/javascript">
var score=80;
if(score>=80)
{ document.write("很棒,成績及格了。"}
else
{ document.write("加油,成績不及格。"); }
</script>
</head> <body> </body> </html>
var score=80;
if(score>=80)
{ document.write("很棒,成績及格了。"}
else
{ document.write("加油,成績不及格。"); }
</script>
</head> <body> </body> </html>
2015-11-10
var mycon = document.getElementById('con');
var mytxt = document.getElementById('txt');
function chcolor(){
mycon.style.color = 'red';
}
function chwidth(){
mytxt.style.width = "400px";
}
function disnone(){
mytxt.style.display = "none";
}
var mytxt = document.getElementById('txt');
function chcolor(){
mycon.style.color = 'red';
}
function chwidth(){
mytxt.style.width = "400px";
}
function disnone(){
mytxt.style.display = "none";
}
添加<script>標簽,使第7行代碼運行,結果窗口顯示"開啟JS之旅!"
2015-11-10
<script language="javascript">
document.write("開啟JS之旅!");
</script>
document.write("開啟JS之旅!");
</script>
2015-11-10