課程
/前端開發(fā)
/JavaScript
/JavaScript入門篇
"改變顏色"、"改變寬高"、"隱藏內(nèi)容"、"顯示內(nèi)容"、"取消設(shè)置"的函數(shù)
2015-01-07
源自:JavaScript入門篇 4-1
正在回答
發(fā)錯(cuò)了。。。。
//定義"改變顏色"的函數(shù)
function chang()
{
? ? txt.style.color="red";
? ? txt.style.backgroundColor="yellow";
}
//定義"改變寬高"的函數(shù)
function widt()
? ? txt.style.width="100px";
? ? txt.style.height="500px";
//定義"隱藏內(nèi)容"的函數(shù)
function hind()
? ? txt.style.display="none";
//定義"顯示內(nèi)容"的函數(shù)
function show()
txt.style.display="block";
//定義"取消設(shè)置"的函數(shù)
function re()
? ?txt.style.height="400px";
? ? txt.style.width="600px";
? ? txt.style.color="";
? ? ?txt.style.backgroundColor="";
? ? }
舉報(bào)
JavaScript做為一名Web工程師的必備技術(shù),本教程讓您快速入門
2 回答隱藏內(nèi)容、顯示內(nèi)容、取消設(shè)置無效
1 回答為什么隱藏內(nèi)容,顯示內(nèi)容還有取消設(shè)置是沒有效果的,改變顏色和寬高是由效果的,代碼如下
3 回答為何顯示內(nèi)容.隱藏內(nèi)容和取消設(shè)置無效
2 回答取消設(shè)置button的函數(shù)內(nèi)容
4 回答顯示內(nèi)容和隱藏內(nèi)容的函數(shù),為什么隱藏之后再顯示就顯示不了呢?
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網(wǎng)安備11010802030151號
購課補(bǔ)貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號
2015-12-17
發(fā)錯(cuò)了。。。。
2015-12-17
//定義"改變顏色"的函數(shù)
function chang()
{
? ? txt.style.color="red";
? ? txt.style.backgroundColor="yellow";
}
//定義"改變寬高"的函數(shù)
function widt()
{
? ? txt.style.width="100px";
? ? txt.style.height="500px";
}
//定義"隱藏內(nèi)容"的函數(shù)
function hind()
{
? ? txt.style.display="none";
}
//定義"顯示內(nèi)容"的函數(shù)
function show()
{
txt.style.display="block";
}
//定義"取消設(shè)置"的函數(shù)
function re()
{
? ?txt.style.height="400px";
? ? txt.style.width="600px";
? ? txt.style.color="";
? ? ?txt.style.backgroundColor="";
? ? }