Question: Im trying to add CSS to a input on keyup. If the input is empty add CSS. I've tried this...

```
            $(input).keyup(function() {
                var input = $(this).attr('id');
                if( input == "" ) {
                  $(input).css( "border", "1px solid #FB9E25" );
                }   
            });

```

Answer: 
<http://jsfiddle.net/DKW7M/>

HTML

```
<input type="text" id="test" />

```

JS:

```
$("#test").keyup(function() {
                var input = $(this);

                if( input.val() == "" ) {
                  input.css( "border", "1px solid #000" );
                }   
            });

```

I changed it to black to make it easier to see.

If you want to do it for multiple id's, try:

```
<form id="some_form">
 <input type="text" />
 <input type="text" />
</form>

```

```js
$("#some_form input").each(function() {
     $(this).keyup(function() {

                var input = $(this);

                if( input.val() == "" ) {
                  input.css( "border", "1px solid #000" );
                }   
            });
   });

```
if you mean, you want to add css if no value then, change to:

```
$(input).keyup(function() {
     var input = $.trim( $(this).val() );
     if( input == "" ) {
         $(this).css( "border", "1px solid #FB9E25" );
     }   
});

```