【发布时间】:2021-02-06 05:22:36
【问题描述】:
.button{
outline-color: rgba(0,0,0,0.7);
width:290px;
margin: 20px 10px 10px 5px;
height:80px;
font-size:44px;
color:orange;
background-color:rgba(0,0,0,0.7);
border: 0;
border-bottom:2px solid black;
cursor:pointer;
}
.button:hover{
background-color:rgba(0,0,0,0.7);
}
.button:focus{
background-color: rgba(0,0,0,0.7);
width: 300px;
}
<form action="" onsubmit="return submitMove()">
<label class="lable">First Coordinate</label>
<div><input class="button" type="text" id="currentCoordinate" onchange="backgroundColor: rgba(0,0,0,0.7)" onclick="clickInput()"></div>
<lable class="lable">Second Coordinate</lable>
<div><input class="button" type="text" id="moveToCoordinate" onchange="backgroundColor: rgba(0,0,0,0.7)" onclick="clickInput()"></div>
<button class="button" onclick="clickInput()">Submit move</button>
</form>
function clickInput() {
document.getElementById("currentCoordinate").style.backgroundColor = "rgba(0,0,0,0.7)"
document.getElementById("moveToCoordinate").style.backgroundColor = "rgba(0,0,0,0.7)"
}
我想要的是让输入字段完全不改变颜色。我根本做不到。任何需要 CSS 或 javascript 的解决方案都可以。我希望表单颜色始终保持黑色。或者当您单击输入表单时,有没有办法阻止表单执行下拉建议?谢谢
【问题讨论】:
-
请提供代码工作示例或图片
-
@noob 我回答你的问题了吗?
-
抱歉回复晚了,图片已经在帖子里了。单击带有解释的链接。对不起,谢谢
标签: javascript css forms