猿问

为什么我设置的按钮没反应?

<!DOCTYPE HTML>

<html>

<head>

<meta http-equiv="Content-Type" Content="text/html; charset=utf-8" />

<title>zhaoying制作</title>

<style type="text/css">

body{font-size:12px;}

#txt{

    height:400px;

    width:600px;

border:#333 solid 1px;

padding:5px;

    background:green;}

p{

padding:20px;

width:600px;

border:red solid 1px;

line-height:18px;

text-indent:4em;

    color:pink;

    background:#333}

</style>

<script type="text/javascript">

function one(){

var mychar=document.getElementById("see");

mychar.style.display="none";

}

function two(){

var mychar=document.getElementById("see");

mychar.style.display="block";

}

function three(){

var mychar="这里没有彩蛋";

alert(mychar);

}


</script>

</head>

<body>

  <h2 id="con">学霸排行榜</H2>

  <div id="txt"> 

     <h5>制作一个列表 </h5>  

     <ol >   

        <li >我是<a href=http://www.imooc.com>第一名</a>。</li>

        <li>我是<a href=http://www.imooc.com>第二名</a>。</li>

        <li>我是<a href=http://www.imooc.com>第三名</a>。</li>

        <li>我是<a href=http://www.imooc.com>第四名</a>。</li>

        </ol>

  </div>


  <p id="see">如果你也有需要可以向我们投稿,我们十分欢迎的来信,咪咪颖为你点赞。此处是我们的邮箱地址</p>

  <form>

    <input type="button" value="设置隐藏" onclick="one()" />  

    <input type="button" value="设置显示" onclick="two()" />

    <input type="button" value="设置惊喜" onclick="three()" />  

  </form>

</body>

</html>


小幸运17
浏览 2246回答 7
7回答

qq_阳光斜影_03450181

分号写错  放到编辑器中看下第三个函数var mychar="这里没有彩蛋";分号用了个中文输入法的分号

Mr小尛

var mychar="这里没有彩蛋";//这个分号打成中文的了。。。

侠客岛的含笑

65行用的中文标点,一个分号毁一生啊,希望采纳

kiwn_chen

高手好多

FINE_Android

恩,编程人员需要一个好的输入法。
随时随地看视频慕课网APP
我要回答