Demonstração de formatação condicional

HTML

<div>
   <input type="text" id="input" style="float:left"> <span id="alert"></span>
</div>

CSS

span{
   width : 15px;
    height : 15px;
    margin-top : 3px;
    border-radius : 10px;
    background : red;
    display : block;
    float : left;
    box-shadow : 0px 0px 1px 1px #900000;
}

JavaScript

$('#input').keypress(function(e){
    if(eval(this.value +
           String.fromCharCode(e.keyCode))
       <= 0){
      $('#alert').show();
    }else $('#alert').hide();
})