課程
/前端開發(fā)
/JavaScript
/JavaScript入門篇
為什么我的答案不顯示,點了那個"不會了怎么辦"也沒啥反應(yīng),有的章節(jié)是的,有的不是,搞得很是憂桑,不知道哪位大神可以代為解答一下,不然遇到不會的根本就傻眼了
2016-09-05
源自:JavaScript入門篇 4-1
正在回答
有的會給些提示,有的沒有,很正常,下邊的評論區(qū)有好多人的討論,你也可以看看我的~~
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" Content="text/html; charset=utf-8" />
<title>javascript</title>
<style type="text/css">
body{font-size:12px;}
#txt{
? ? height:400px;
? ? width:600px;
border:#333 solid 1px;
padding:5px;}
p{
line-height:18px;
text-indent:2em;}
</style>
</head>
<body>
? <h2 id="con">JavaScript課程</H2>
? <div id="txt">?
? ? ?<h5>JavaScript為網(wǎng)頁添加動態(tài)效果并實現(xiàn)與用戶交互的功能。</h5>
? ? ? ? <p>1. JavaScript入門篇,讓不懂JS的你,快速了解JS。</p>
? ? ? ? <p>2. JavaScript進階篇,讓你掌握JS的基礎(chǔ)語法、函數(shù)、數(shù)組、事件、內(nèi)置對象、BOM瀏覽器、DOM操作。</p>
? ? ? ? <p>3. 學(xué)完以上兩門基礎(chǔ)課后,在深入學(xué)習(xí)JavaScript的變量作用域、事件、對象、運動、cookie、正則表達式、ajax等課程。</p>
? </div>
? <form>
? ? <input type="button" value="改變顏色" onclick="yanse()"> ?
? ? <input type="button" value="改變寬高" onclick="kgao()">
? ? <input type="button" value="隱藏內(nèi)容" onclick="ycang()">
? ? <input type="button" value="顯示內(nèi)容" onclick="xshi()">
? ? <input type="button" value="取消設(shè)置" onclick="qxiao()">
? </form>
? <script type="text/javascript">
function yanse(){
document.getElementById("con").style.color="red";
? ? ?document.getElementById("txt").style.color="red";
}
function kgao(){
document.getElementById("txt").style.width="400px";
document.getElementById("txt").style.height="300px";
function ycang(){
document.getElementById("txt").style.display="none";
function xshi(){
document.getElementById("txt").style.display="block";
function qxiao(){
if (confirm("確認取消設(shè)置嗎?")) {
?txt.style.cssText="none";?
?con.style.cssText="none";
} else{}
? </script>
</body>
</html>
慕仰5293895 提問者
劉蘿卜 回復(fù) 慕仰5293895 提問者
取消設(shè)置沒效果
可以啊
舉報
JavaScript做為一名Web工程師的必備技術(shù),本教程讓您快速入門
1 回答求解答為什么我的顯示不了
3 回答為什么我的alert不顯示
1 回答為什么答案還是錯的?
2 回答我的答案喲
2 回答為什么不顯示?
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網(wǎng)安備11010802030151號
購課補貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號
2016-09-06
有的會給些提示,有的沒有,很正常,下邊的評論區(qū)有好多人的討論,你也可以看看我的~~
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" Content="text/html; charset=utf-8" />
<title>javascript</title>
<style type="text/css">
body{font-size:12px;}
#txt{
? ? height:400px;
? ? width:600px;
border:#333 solid 1px;
padding:5px;}
p{
line-height:18px;
text-indent:2em;}
</style>
</head>
<body>
? <h2 id="con">JavaScript課程</H2>
? <div id="txt">?
? ? ?<h5>JavaScript為網(wǎng)頁添加動態(tài)效果并實現(xiàn)與用戶交互的功能。</h5>
? ? ? ? <p>1. JavaScript入門篇,讓不懂JS的你,快速了解JS。</p>
? ? ? ? <p>2. JavaScript進階篇,讓你掌握JS的基礎(chǔ)語法、函數(shù)、數(shù)組、事件、內(nèi)置對象、BOM瀏覽器、DOM操作。</p>
? ? ? ? <p>3. 學(xué)完以上兩門基礎(chǔ)課后,在深入學(xué)習(xí)JavaScript的變量作用域、事件、對象、運動、cookie、正則表達式、ajax等課程。</p>
? </div>
? <form>
? ? <input type="button" value="改變顏色" onclick="yanse()"> ?
? ? <input type="button" value="改變寬高" onclick="kgao()">
? ? <input type="button" value="隱藏內(nèi)容" onclick="ycang()">
? ? <input type="button" value="顯示內(nèi)容" onclick="xshi()">
? ? <input type="button" value="取消設(shè)置" onclick="qxiao()">
? </form>
? <script type="text/javascript">
function yanse(){
document.getElementById("con").style.color="red";
? ? ?document.getElementById("txt").style.color="red";
}
function kgao(){
document.getElementById("txt").style.width="400px";
document.getElementById("txt").style.height="300px";
}
function ycang(){
document.getElementById("txt").style.display="none";
}
function xshi(){
document.getElementById("txt").style.display="block";
}
function qxiao(){
if (confirm("確認取消設(shè)置嗎?")) {
?txt.style.cssText="none";?
?con.style.cssText="none";
} else{}
}
? </script>
</body>
</html>
2016-09-11
取消設(shè)置沒效果
2016-09-06
可以啊