首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >更改h3标记内容

更改h3标记内容
EN

Stack Overflow用户
提问于 2015-04-03 15:47:54
回答 2查看 326关注 0票数 0
代码语言:javascript
复制
     <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标签的内容更改为'>‘这个符号,当鼠标悬停在它上面时。该怎么做呢?

我用javascript写代码来改变h3的内容,但它不会显示任何效果?我也不知道原因?

EN

回答 2

Stack Overflow用户

发布于 2015-04-03 15:51:37

您在setTimeout调用中将function拼写为funtion

票数 2
EN

Stack Overflow用户

发布于 2015-04-03 15:51:53

function拼写错误,应该是function:

代码语言:javascript
复制
setTimeout(function(){
    document.getElementById("date").value = current_date.toDateString();
},1000);
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/29428289

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档