Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    
    <head>
        <style>
                .not_ok {
                background: url(notok.gif);
                width: 32px;
                height: 28px;
                }
        </style>
        <script src="jquery-1.6.min.js"></script>
        <script>
            $(document).ready(function() {
                $("#input_submit").click(function() {
                    var usr = $("#input_username").val();
                    if (usr.length >= 3) {
                        $("#status").html('Checking availability...');
                    } else {
                        $("#status").html('<div class="not_ok"></div>');
                    }
                });
            });
        </script>
    </head>
    
    <body>
        <div id="status"></div>
        <form method="post" action="">
            <p>
                <input type="text" name="name" />
            </p>
            <p>
                <input class="submit" type="submit" value="Submit" id="input_submit" />
            </p>
        </form>
    </body>

</html>