}else if(id==3){
txt.style.display="block"
}else if(id==4){
var setting= confirm("你確定要取消設(shè)置么")
if(setting){
document.write("點(diǎn)擊了確定")
}else{
document.write("點(diǎn)擊了取消")
}
}
}
txt.style.display="block"
}else if(id==4){
var setting= confirm("你確定要取消設(shè)置么")
if(setting){
document.write("點(diǎn)擊了確定")
}else{
document.write("點(diǎn)擊了取消")
}
}
}
2021-09-22
function chang(id){
var txt= document.getElementById("txt")
if(id==0){
txt.style.color="red"
txt.style.backgroundColor="#edd"
}else if(id==1){
txt.style.width="200"
txt.style.height="200"
}else if(id==2){
txt.style.display="none"
var txt= document.getElementById("txt")
if(id==0){
txt.style.color="red"
txt.style.backgroundColor="#edd"
}else if(id==1){
txt.style.width="200"
txt.style.height="200"
}else if(id==2){
txt.style.display="none"
2021-09-22
<input type="button" value="改變顏色" onclick="chang(0)" >
<input type="button" value="改變寬高" onclick="chang(1)">
<input type="button" value="隱藏內(nèi)容" onclick="chang(2)">
<input type="button" value="顯示內(nèi)容" onclick="chang(3)">
<input type="button" value="取消設(shè)置" onclick="chang(4)">
<input type="button" value="改變寬高" onclick="chang(1)">
<input type="button" value="隱藏內(nèi)容" onclick="chang(2)">
<input type="button" value="顯示內(nèi)容" onclick="chang(3)">
<input type="button" value="取消設(shè)置" onclick="chang(4)">
2021-09-22
最贊回答 / qq_慕設(shè)計(jì)8188320
<!DOCTYPE html><html> <head> <meta charset="utf-8"> <title></title> <script type="text/javascript"> function openwindow(){ var URL = prompt("請輸入你的網(wǎng)址或選擇默認(rèn)網(wǎng)址", 'https://www.imoo...
2021-09-16
function openWindow(){
var isopen=confirm('是否打開網(wǎng)站');
if(isopen==true){
var url=prompt("輸入網(wǎng)址","http://idcbgp.cn")
if(url!=null){
window.open(url,'_bank','width=400,height=500,menubar=no,toolbar=no')
}
}
}
var isopen=confirm('是否打開網(wǎng)站');
if(isopen==true){
var url=prompt("輸入網(wǎng)址","http://idcbgp.cn")
if(url!=null){
window.open(url,'_bank','width=400,height=500,menubar=no,toolbar=no')
}
}
}
2021-09-07
最贊回答 / 汝慕寒
<...圖片...>注:js的執(zhí)行順序是單線程依次執(zhí)行的因此將script放在head里結(jié)果是null,將script放在body里結(jié)果是object
2021-09-06
已采納回答 / qq_慕用0479397
backgroubdColor記得color中的c要大寫設(shè)置寬高都要加px,如width="500px"取消設(shè)置用這句就好了document.getElementById('txt').style='none';
2021-09-03