作者:郑青青11_875 | 来源:互联网 | 2023-09-10 14:38
Ihaveaninputfield,andthecolorofthetextinitisblack.(Imusingjquery.placeholder)Let
I have an input field, and the color of the text in it is black. (I'm using jquery.placeholder) Let's say the text in there is "E-Mail"
我有一个输入字段,其中的文本颜色为黑色。 (我正在使用jquery.placeholder)让我们说那里的文字是“电子邮件”
When you click on this field, the black placeholding text dissapears (thanks to jquery.placeholder).
当您单击此字段时,黑色占位文本消失(感谢jquery.placeholder)。
Any text inputted into this field, I want it to turn red, and when you deselect this field, I want it to stay red.
输入到此字段的任何文本,我希望它变为红色,当您取消选择此字段时,我希望它保持红色。
At the moment, the text saying "E-Mail" is black, and anything I type into is red, which is great, but as soon as i deselect, it goes back to black. Can anyone help me? I want the text to stay red, even after it's deselected. Here is my code
目前,“电子邮件”的文字是黑色的,我输入的任何内容都是红色的,这很棒,但是一旦取消选择,它就会变回黑色。谁能帮我?我希望文本保持红色,即使在取消选中后也是如此。这是我的代码
textarea:focus, input:focus {
color: #ff0000;
}
input, select, textarea{
color: #000;
}
4 个解决方案