css - Change text color of selected option item in php -
i want change background color of selected option item in php coulnd that. add indicator(*) begining of selected option bellow code not need that. need change text color of selected form item in php.
adding style="background-color:red" $a works.!
<select name="dest"> <?php $a=''; $sql2 = "select evaperiod evaluationperiod"; $query2 = mysql_query($sql2); if(mysql_num_rows($query2)>0) { $x='20'; $guncel=''; while($result=mysql_fetch_array($query2)) { $period = $result['evaperiod']; if($period==$donemm) $a=" selected='selected' style='background-color:red'"; if($period==$periodd) $guncel='*'; else $a=''; print "<option value='$period'$a>$guncel$x$period</option>"; $guncel=''; } } ?> </select>
append style="background-color:(yourcolor)"
$a
Comments
Post a Comment