Label behavior match input field
<p>Below is my code, I am needing to get to where the label name will match the behavior that my field currently does. If nothing is entered the field is changed to a red background. If it is focused it goes back to white. I am needing the font color of the label to match color of the field and match the same behavior.</p>

<pre><code>    &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
&lt;title&gt;Lab06 - Form Validation&lt;/title&gt;
&lt;script type="text/javascript" charset="utf-8"&gt;



    function passcheck(){
        var pw1 = document.forms[ 0 ].password.value;
        var pw2 = document.forms[ 0 ].passcomf.value;

        if ( pw1 != pw2 ) {
            alert ("You did not enter the same new password twice. Please re-enter your password.");
            return false;
        }else{
            return true;
        }
    }


    function validate( ) {
        var errors = new Array( );

        for( var i = 0; i &lt; document.forms[ 0 ].elements.length ; i++ ){

            if( document.forms[ 0 ].elements[ i ].type == "text" ) {
                if( document.forms[ 0 ].elements[ i ].value == "" ){
                    errors.push( "The " + document.forms[ 0 ].elements[ i ].name + " field cannot be blank.\n");

                    document.forms[ 0 ].elements[ i ].className = "in_error";



                }


            }

            if( document.forms[ 0 ].elements[ i ].type == "select-one") {
                if(document.forms[ 0 ].elements[ i ].selectedIndex == 0 ) {
                    errors.push( "The " + document.forms[ 0 ].elements[ i ].name + ' was not "Yes, I agree!", you must agree to the "User Agreement."\n');

                    document.forms[ 0 ].elements[ i ].className = "in_error";
                }
         }

            if( document.forms[ 0 ].elements[ i ].type == "select-one") {
                if(document.forms[ 0 ].elements[ i ].selectedIndex == 2 ) {
                    errors.push( "The " + document.forms[ 0 ].elements[ i ].name + ' was not "Yes, I agree!", you must agree to the "User Agreement."\n');

                    document.forms[ 0 ].elements[ i ].className = "in_error";
                }
         }







    }
        if( errors.length == 0 ) {
            return true;
        } else {
            clear_errors( );
            show_errors( errors );

            return false;
        }


    }



    function clear_errors( ){
        var div = document.getElementById( "errors" );
        while( div.hasChildNodes( ) ){
            div.removeChild( div.firstChild );
        }
    }

    function show_errors ( errors ) {
        var div = document.getElementById( "errors" );
        for( var i = 0; i &lt; errors.length; i++ ){
            var error = document.createTextNode( errors[ i ] );
            var p = document.createElement( "p" );
            p.appendChild( error );
            div.appendChild( p );
        }
    }


    window.onload = function( ) {
        document.forms[ 0 ].onsubmit = validate;

    }



&lt;/script&gt;


&lt;style type="text/css" media="screen"&gt;
    #errors {
        color: #F00;
    }
    .in_error {
        background-color: #F00;
    }
    input:focus {
        background-color: #FFF;
    }
    select:focus {
        background-color: #FFF;
    }
&lt;/style&gt;

&lt;/head&gt;

&lt;body&gt;

    &lt;h1&gt;Form Validation&lt;/h1&gt;

    &lt;div id="errors"&gt;&lt;/div&gt;

    &lt;form action="" method="post" onsubmit="return passcheck()"&gt;
         &lt;p&gt;
            &lt;label for="firstname" id="labelfirstname"&gt;First name:&lt;/label&gt;
            &lt;input type="text" name="First name" value="" id="firstname" /&gt;
        &lt;/p&gt;
         &lt;p&gt;
            &lt;label for="lastname" id="labellastname"&gt;Last name:&lt;/label&gt;
            &lt;input type="text" name="Last name" value="" id="lastname"/&gt;
        &lt;/p&gt;
         &lt;p&gt;
            &lt;label for="middlei" id="labelmiddlei"&gt;Middle initial:&lt;/label&gt;
            &lt;input type="text" name="Middle initial" value="" id="middlei"/&gt;
        &lt;/p&gt;
         &lt;p&gt;
            &lt;label for="address" id="labeladdress"&gt;Street address:&lt;/label&gt;
            &lt;input type="text" name="Street address" value="" id="address"/&gt;
        &lt;/p&gt;
         &lt;p&gt;
            &lt;label for="city" id="labelcity"&gt;City:&lt;/label&gt;
            &lt;input type="text" name="City" value="" id="city"/&gt;
        &lt;/p&gt;
         &lt;p&gt;
            &lt;label for="State" id="labelstate"&gt;State:&lt;/label&gt;
            &lt;input type="text" name="State" value="" id="state"/&gt;
        &lt;/p&gt;
         &lt;p&gt;
            &lt;label for="zipcode" id="idzipcode"&gt;Zipcode:&lt;/label&gt;
            &lt;input type="text" name="Zipcode" value="" id="zipcode"/&gt;
        &lt;/p&gt;
         &lt;p&gt;
            &lt;label for="username" id="labelusername"&gt;Username:&lt;/label&gt;
            &lt;input type="text" name="Username" value="" id="username"/&gt;
        &lt;/p&gt;
         &lt;p&gt;
            &lt;label for="password" id="labelpassword"&gt;Password:&lt;/label&gt;
            &lt;input type="text" name="Password" value="" id="password"/&gt;
        &lt;/p&gt;
         &lt;p&gt;
            &lt;label for="passcomf" id="labelpasscomf"&gt;Password comfirmation:&lt;/label&gt;
            &lt;input type="text" name="Password comfirmation" value="" id="passcomf"/&gt;
        &lt;/p&gt;
         &lt;p&gt;
            &lt;label for="agreement" id="labelagreement"&gt;User Agreement&lt;/label&gt;
            &lt;select name="User Agreement" id="agreement"&gt;
                &lt;option&gt;&lt;/option&gt;
                &lt;option&gt;Yes, I agree!&lt;/option&gt;
                &lt;option&gt;No, I do not agree!&lt;/option&gt;
                &lt;/select&gt;
        &lt;/p&gt;
        &lt;p&gt;&lt;input type="submit" value="Register &amp;rarr;" onclick="return passcheck(); return true;"/&gt;&lt;/p&gt;
        &lt;/form&gt;
&lt;/body&gt;

    &lt;/html&gt;
</code></pre>
