不只要加單位,還要記得加引號喔!
mychar.style.color="red";
mychar.style.backgroundColor="#CCC";
mychar.style.width="300px";
mychar.style.color="red";
mychar.style.backgroundColor="#CCC";
mychar.style.width="300px";
2016-05-19
用了傻辦法
function del(){
var mychar4=document.getElementById("txt");
var mymessage=confirm(" 是否確認取消設置?");
if(mymessage==true)
{
mychar4.style.color="#000";
mychar4.style.width="600px";
mychar4.style.height="400px";
}
else
{}
}
//定義"取消設置"的函數
function del(){
var mychar4=document.getElementById("txt");
var mymessage=confirm(" 是否確認取消設置?");
if(mymessage==true)
{
mychar4.style.color="#000";
mychar4.style.width="600px";
mychar4.style.height="400px";
}
else
{}
}
//定義"取消設置"的函數
<script type="text/javascript">
var score=80;
if(score>=60)
{
document.write("不及格");
}
else
{
document.write("及格");
}
</script>
var score=80;
if(score>=60)
{
document.write("不及格");
}
else
{
document.write("及格");
}
</script>
2016-05-18
function openWindow(){
var open;
var message=confirm("打開新的窗口嗎?")
if(message==true){
open=prompt("請輸入你要打開的網址:","http://www.xianlaiwan.cn/");
window.open(open,'_blank','width=400,height=500,menubar=no,toolbar=no');
}
else null;
}
var open;
var message=confirm("打開新的窗口嗎?")
if(message==true){
open=prompt("請輸入你要打開的網址:","http://www.xianlaiwan.cn/");
window.open(open,'_blank','width=400,height=500,menubar=no,toolbar=no');
}
else null;
}
function rec()
{
var love=prompt("你倒是說話啊");
if (love=="A"){document.write("滾");}
else if(love=="B"){document.write("你還不明白嗎");}
else{document.write("哥們你在意個屁啊");}
{
var love=prompt("你倒是說話啊");
if (love=="A"){document.write("滾");}
else if(love=="B"){document.write("你還不明白嗎");}
else{document.write("哥們你在意個屁啊");}
2016-05-17
var massage=confirm("啦啦啦啦")
if(massage=true)
{
document.write("得瑪西亞!")
}
else
{
document.write("嘿嘿嘿")
}
if(massage=true)
{
document.write("得瑪西亞!")
}
else
{
document.write("嘿嘿嘿")
}
2016-05-17
http://img1.sycdn.imooc.com//52e3677900013d6a05020261.jpg
2016-05-17