有一次按钮,我希望点击他之后会变亮,让用户知道他正在这个界面内,请问如何设置
改变按钮的颜色属性,或是更换背景图啊都可以啊,觉得你问的好奇怪
这样子:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript">
function test1(){
document.getElementById("button1").style.background="blue";
}
</script>
</head>
<body>
<button type="button" id="button1" onclick = "test1()">测试</button>
</body>
</html>
当作标签?你onclick里做事件点一下把这个的图片换成亮的
改一下背景色即可。
jquery:
$(this).css({"background-color":"red"});