html - Changing the color of dropdown placeholder in form -
i'm making form drop down element. want placeholder text gray, in 'text input' forms, , answer black.
i managed make answers color in dropdown menu, when select it, changes color of placeholder.
the code i'm using;
<select class="remindmedropdown"> <option value="0" selected disabled>question</option> <option value="1">answer 1</option> <option value="2">answer 2</option> <option value="3">answer 3</option> </select>
css:
.remindmedropdown { width: 240px; height: 40px; background-color: #fff; padding: 10px; margin-right: 30px; outline-color:#a7d5e4; color:#990000; } .remindmedropdown option { color: gray; }
edit: jsfiddle http://jsfiddle.net/qkyc9/1/
try this:
.remindmedropdown option:checked { color: gray; }
for dynamic change javascript:
<select id="selection" class="remindmedropdown" onchange="colorset()"> ... </select> <script> function colorset(){ document.getelementbyid('selection').style.color="black"; } </script>
Comments
Post a Comment