为了账号安全,请及时绑定邮箱和手机立即绑定

为什么我写的代码按钮没有反应

为什么我的代码按钮没有反馈    ~~~


<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为网页添加动态效果并实现与用户的交互功能。</h5>

<ol>

<li>JavaScript入门篇,让不懂js的你,快速了解JS。</li>

<li>JavaScript进阶篇,让你掌握JS的基础语法、函数、数组、事件、内置对象、BOM浏览器、DPM操作。</li>

<li>学完以上两门基础课后,在深入学习JavaScript的变量作用域、事件、对象、运动、cookie、正则表达式、ajax等课程。</li>

</ol>

</div>

<form>

<!-- 当点击相应按钮,执行相应时间 -->

<input type="button" value="改变颜色" onclick="Ccolor()"/>

<input type="button" value="改变宽高" onclick="CwdithAndheigt()"/>

<input type="button" value="隐藏内容" onclick="HideContent()"/>

<input type="button" value="显示内容" onclick="ShowContent()"/>

<input type="button" value="取消设置" onclick="CannelSeting()"/>

</form>

<script src="action.js"></script>

</body>

</html>



var mychar=getElementById("txt");

function Ccolor(){

mychar.style.color="red";

mychar.style.backgroundColor="bule";

}

//定义改变宽高的函数

function CwdithAndheigt(){

mychar.style.wdith="100px";

mychar.style.height="300px";

}

//定义隐藏内容的函数

function HideContent(){

mychar.style.display=none;

}

//显示内容的函数

function ShowContent(){

mychar.style.display=block;

}

//定义取消设置的函数

function CannelSeting(){

if(confirm("是否恢复之前的设置")==true){

}

}


正在回答

举报

0/150
提交
取消

为什么我写的代码按钮没有反应

我要回答 关注问题
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号