How to clear a td content upon deleting/backspacing/clearing text in a textbox
<p>I am working in php/JQuery and this is what I have coded so far ...<br><br>
<strong>username.php</strong><br><br></p>

<pre><code>&lt;html&gt;
&lt;head&gt;
    &lt;script type="text/javascript" src="js/jquery-1.7.1.min.js"&gt;&lt;/script&gt;

    &lt;script type="text/javascript"&gt;

        $(document).ready(function(){

            $("#username").change(function(){

                if($('#username').val().length == 0){

                    $('#message').empty();
                }
                else{

                    $("#message").html("&lt;img src='images/loader.gif' /&gt; checking...");

                    var username = $("#username").val();

                    $.post( "check.php", { user: $("#username").val() }, function (data){
                        if(data == 0){

                            $("#message").html("&lt;img src='images/tick.png' /&gt;&lt;span style='font-size:13px; color: black'&gt; Username available&lt;/span&gt;");                               
                            proceed = true;

                        }
                        else{

                            $("#message").html("&lt;img src='images/err.png' /&gt;&lt;span style=font-size:13px; color: red'&gt; Username already taken&lt;/span&gt;");                               
                            proceed = false;
                        }
                    });                     
                }       
            });
        });

    &lt;/script&gt;

&lt;/head&gt;

&lt;body&gt;  
    &lt;form id="user"&gt;           
        &lt;table&gt;
            &lt;tr&gt;
                &lt;td&gt;Username&lt;/td&gt;
                &lt;td&gt;:&lt;/td&gt;
                &lt;td&gt;&lt;input type="text" name="username" id="username"/&gt;&lt;/td&gt;
                &lt;td id="message"&gt;&lt;/td&gt;
            &lt;/tr&gt;
            &lt;tr&gt;
                &lt;td&gt;Password&lt;/td&gt;
                &lt;td&gt;:&lt;/td&gt;
                &lt;td&gt;&lt;input type="text" name="password" id="password" /&gt;&lt;/td&gt;
            &lt;/tr&gt;
        &lt;/table&gt;

        &lt;button type="submit" name="submit" &gt;Check&lt;/button&gt;
    &lt;/form&gt; 
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>Now what I want to achieve is:</p>

<p>As I <strong>backspace/delete</strong> the whole text in the textbox with the <strong>ID = "username"</strong> , this should clear the text that appears in the td with the <strong>ID = "message"</strong>    <br><br>
How can achieve this with javascript.<br>
Any help will be much appreciated.      </p>