<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的内容,但它不会显示任何效果?我也不知道原因?
发布于 2015-04-03 15:51:37
您在setTimeout调用中将function拼写为funtion
发布于 2015-04-03 15:51:53
function拼写错误,应该是function:
setTimeout(function(){
document.getElementById("date").value = current_date.toDateString();
},1000);https://stackoverflow.com/questions/29428289
复制相似问题