2015-04-03 95 views
-1
 <html> 
    <head> 
      <style> 
       body{ 
        background-color:#6badf6; 
       } 
       #button-layout{ 
       background-color: #3b81cf; 
       width:100px; 
       height:40px; 
       border-radius:10px; 
       margin-left:50%; 
       margin-top: 25%; 
      } 
     #button-name{ 
      font-family: verdana; 
      font-size: 14px; 
      color: white; 
      padding-left: 22px; 
      padding-top: 11px; 

      } 
     #button-name:hover{ 
      cursor: pointer; 

     } 

    </style> 
    <script> 

     function change-content(){ 
       document.getElementById('button-name').innerHTML = ">"; 
     } 
    </script> 
    </head> 
    <body> 
     <div id="button-layout"> 
       <h3 id="button-name" onmouseover="change-content()">Submit</h3> 
     </div> 
    </body> 
    </html> 

我使用div标记创建了一个按钮。它实际上并不是一个按钮,但它看起来像一个按钮。 这里我想将h3标签的内容更改为'>'这个符号,当鼠标悬停在它上面时。怎么做?更改h3标记内容

我在javascript中编写代码来更改h3内容,但它不会显示任何影响?我不知道为什么?

+2

它应该是'function'而不是'发布前funtion' – 2015-04-03 07:52:35

+0

ATLEAST调试码。 – 2015-04-03 07:53:08

回答

2

你拼写function作为setTimeout调用

2

Funtion funtion拼写错了,应该是功能:

setTimeout(function(){ 
    document.getElementById("date").value = current_date.toDateString(); 
},1000);