我有以下代码来加载基于值的输入字段的颜色gap
echo "<td class='gap'>";
echo "<input name = gap-".$compi['Competence_ID']." type='text' readonly style='width:20px;' value='";
if(isset($compi['gap']) && $compi['gap']!=0){
echo $compi['gap'];
}
$color='';
if($compi['gap']>=0){
$color='#3CB371';$text="gap bigger than 0";
}
if($compi['gap']<0){
$color='#FFFFFF';$text="gap is not";
}
echo "' style='background-color:".$color.";'>";
echo $text."</td>";
代码打印正确,$text
但输入的颜色没有改变..