Why not work this code?

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
                .not_ok {
                background: url(notok.gif);
                width: 32px;
                height: 28px;
        <script src="jquery-1.6.min.js"></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>');
        <div id="status"></div>
        <form method="post" action="">
                <input type="text" name="name" />
                <input class="submit" type="submit" value="Submit" id="input_submit" />


The field with the id of input_username doesn’t exist, simply add id=“input_username” to the field with the name of name. Also your form will submit no matter what so you will need to update your code so it prevents the default action like the example below…

$(function() {
    $("#input_submit").click(function(e) {
        // Your code here...