[英]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. 我使用div标签创建了一个按钮。 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.
当鼠标悬停在其上时,我想将h3标签的内容更改为“>”这个符号。 How to do it?
怎么做?
I write code in javascript to change h3 contents but it will not show any effect? 我在javascript中编写代码来更改h3内容,但不会显示任何效果? I don't know why?
不知道为什么
您在setTimeout调用中将function
拼写为funtion
Funtion is spelled wrong, it should be function: 函数的拼写错误,应具有以下功能:
setTimeout(function(){
document.getElementById("date").value = current_date.toDateString();
},1000);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.