-我有一个按钮:-我想用javascript禁用它:document.getElementById(“ input-datestart”)。disabled = true; -Css:
input:disabled {
background-color: #fff!important;
color: #000;
}
文字颜色[color:#000;]在我的计算机的浏览器上可以使用,但是在平板电脑上不能使用,请在图片下方找到此处输入图片说明
您可以将其用于多个操作系统。
使背景和文本对屏幕可见,我在您的提琴中观察到的是
transparent
对用户而言,因此可以随时修改颜色代码以使其在devices
和之间保持一致platforms
。
document.getElementById("input-datestart").disabled = true;
input:disabled {
-webkit-text-fill-color: #880000;
/* Override iOS / Android font color change */
-webkit-opacity: 1;
/* Override iOS opacity change affecting text & background color */
color: #880000;
/* Override IE font color change */
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<input value="text value" name="datePlan" id="input-datestart" readonly="" type="text">
</body>
</html>
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句