AnshulJS
AnshulJS

Reputation: 328

change h3 tag content

     <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>

I created a button using div tag. It is not actually a button but it is look like a button. Here I want to change the content of h3 tag to '>' this symbol when mouse is hover on it. How to do it?

I write code in javascript to change h3 contents but it will not show any effect? I don't know why?

Upvotes: 0

Views: 504

Answers (2)

Thalsan
Thalsan

Reputation: 5690

Funtion is spelled wrong, it should be function:

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

Upvotes: 2

Jules Gagnon-Marchand
Jules Gagnon-Marchand

Reputation: 3791

you spelled function as funtion in the setTimeout call

Upvotes: 2

Related Questions