Y que se me ponga de color rojo el td. El código que tengo es este:
Código PHP:
  
<html>
<head>
 <script src="scripts/jquery-1.7.min.js" type="text/javascript"></script>
<script type="text/javascript" >
 
    var ProcesarFormulario = function(codigo)
    {
        
    
        var campo = "#ingresar_cant" + codigo.toString();
        if($(campo).val() != "")
        {
            var valor = $(campo).val();
        
            $.ajax({
               type: "POST",
               url: "up.php",
               data: "valor=" +valor + "&codigo=" + codigo,
               success: function(datos){
                    location.href = "abastos.php";
                    
                }
            });
        }
        else
        {
            alert("Ingrese una cantidad");
        }
    }
 
</script>
 
<script type="text/javascript">
function resaltaPrimero() {
    var t = document.getElementsByTagName('tr');
    t[0].style.fontSize = '50px';
    if (cantidad_existente <= cantidad_min){
        t[0].style.backgroundColor = '#F81212';
    }
}
</script>
 
</head>
<body onLoad="resaltaPrimero();">
<h1>Gestion de Abastos</h1><Br><Br>
<FORM ACTION="up.php" method=GET"><br><br><bR> 
 <TABLE BORDER=1 CELLSPACING=1 CELLPADDING=1 align="center"> 
  <?php  include("conexion.php");  
  $queEmp = "SELECT * FROM registro";     
  $resEmp = mysql_query($queEmp, $conexion) or die(mysql_error());     
  $totEmp = mysql_num_rows($resEmp);     
  echo"<TR>     
  <td><p>Abastos</td>         
  <td><p>Cantidad Minima</td>         
  <td><p>Cantidad Existente</td>         
  <td><p>Ingresar cantidad</td></tr>";             
  while ($rowEmp = mysql_fetch_assoc($resEmp)) {         
  echo "<tr>         
  <td><p>".$rowEmp['nombre']."</td>                 
  <td><p>".$rowEmp['cantidad_min']."</td>                 
  <td><p>".$rowEmp['cantidad_existente']."</td>
<td valign=middle><p><input type='text' id='ingresar_cant".$rowEmp['codigo']."' >   <input type='button' onclick='ProcesarFormulario(".$rowEmp['codigo'].")' value='guardar' ></td>";
       }
?></TABLE></FORM>
<div id="dsql" ></div>
<center><a href="inicio.php">Inicio</a></center>
 
</body>
</html>   De ante mano muchas gracias.
 

