//定義"取消設置"的函數
function returnback(){ //請忽略函數名……
var box=confirm("是否還原設置?")
if(box==1){
txt.style=null;
}
else{}
}
function returnback(){ //請忽略函數名……
var box=confirm("是否還原設置?")
if(box==1){
txt.style=null;
}
else{}
}
2016-02-21
function openWindow()
{
var str=confirm("是否打開窗口")
if(str==true)
{
var dizhi= prompt("默認網址","http://imooc.com/");
if(dizhi!=null)
window.open("dizhi",'http://www.xianlaiwan.cn/','_blank',width=200,height=500,menubar=no,toolbar=no,')
}
}
{
var str=confirm("是否打開窗口")
if(str==true)
{
var dizhi= prompt("默認網址","http://imooc.com/");
if(dizhi!=null)
window.open("dizhi",'http://www.xianlaiwan.cn/','_blank',width=200,height=500,menubar=no,toolbar=no,')
}
}
在style設置個樣式
用document.getElementById找到命名ID
用className把 樣式 加到 ID 的元素里
用document.getElementById找到命名ID
用className把 樣式 加到 ID 的元素里
2016-02-21
('www.84fp.com,_blank,width=600px,height=400px,top=100px,left=0') 這樣也行 參數分開''擴起來 和 合起來 一樣的
2016-02-21
function Wopen(){
window.open('www.84fp.com','_blank','width=600px,height=400px,top=100px,left=0')
}
</script>
</head>
<body>
<input name="button" type="button" onClick="Wopen()" value="啪啪啪" / >
window.open('www.84fp.com','_blank','width=600px,height=400px,top=100px,left=0')
}
</script>
</head>
<body>
<input name="button" type="button" onClick="Wopen()" value="啪啪啪" / >
2016-02-21
score =prompt("你雞雞多長啊?") ;
if(score>=18)
{
document.write("你很棒!");
}
else if(score>=16)
{
document.write("不錯吆!");
}
else if(score>=14)
{
document.write("勉強能用");
}
else
{
document.write("抱抱,剁了吧");
}
if(score>=18)
{
document.write("你很棒!");
}
else if(score>=16)
{
document.write("不錯吆!");
}
else if(score>=14)
{
document.write("勉強能用");
}
else
{
document.write("抱抱,剁了吧");
}
2016-02-21
var mymessage=confirm("劉亦菲女士,請問你愿意嫁給木毅力為妻嗎?");
if(mymessage==true)
{
document.write("我愿意");
}
else
{
document.write("我就是愿意");
}
if(mymessage==true)
{
document.write("我愿意");
}
else
{
document.write("我就是愿意");
}
2016-02-21
<script type="text/javascript">
var mychar=document.getElementById("con") ;
document.write("原標題:"+mychar.innerHTML+"<br>"); //輸出原h2標簽內容
mychar.innerHTML="Hello World";
document.write("修改后的標題:"+mychar.innerHTML); //輸出修改后h2標簽內容
</script>
var mychar=document.getElementById("con") ;
document.write("原標題:"+mychar.innerHTML+"<br>"); //輸出原h2標簽內容
mychar.innerHTML="Hello World";
document.write("修改后的標題:"+mychar.innerHTML); //輸出修改后h2標簽內容
</script>
2016-02-21