Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/webpack/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何更改struts2中占位符的颜色。例如占位符=";“年”。我想把今年的字体颜色改成灰色_Struts2 - Fatal编程技术网

如何更改struts2中占位符的颜色。例如占位符=";“年”。我想把今年的字体颜色改成灰色

如何更改struts2中占位符的颜色。例如占位符=";“年”。我想把今年的字体颜色改成灰色,struts2,Struts2,如何更改struts2中占位符的颜色。例如placeholder=“year”。我想将year的字体颜色更改为灰色。如果我尝试更改颜色,则整个列表的颜色都会更改。只是我想把“年”的颜色改成灰色 <s:select list="experienceYear" name="toYear" id="toYear" headerKey="0" headerValue="Year" cssStyle="height:32px; width:14%; " cssClass="prof

如何更改struts2中占位符的颜色。例如placeholder=“year”。我想将year的字体颜色更改为灰色。如果我尝试更改颜色,则整个列表的颜色都会更改。只是我想把“年”的颜色改成灰色

<s:select   list="experienceYear" name="toYear" id="toYear" headerKey="0" 
    headerValue="Year" cssStyle="height:32px; width:14%; "   cssClass="profile-input"    placeholder="Year"/>

可能是这样的吧

HTML

<select id="toYear">
    <option value="0" selected="selected">Year...</option>
    <option value="1">2011</option>
    <option value="2">2013</option>
    <option value="2">2014</option>
</select>
$("#toYear").change(function () {
if($(this).val() == "0") $(this).addClass("empty");
else $(this).removeClass("empty")
});
$("#toYear").change();
JavaScript

<select id="toYear">
    <option value="0" selected="selected">Year...</option>
    <option value="1">2011</option>
    <option value="2">2013</option>
    <option value="2">2014</option>
</select>
$("#toYear").change(function () {
if($(this).val() == "0") $(this).addClass("empty");
else $(this).removeClass("empty")
});
$("#toYear").change();

工作示例

检查我的答案………不要让我投赞成票。。。。。。