Orkut style div update on click
<p>I am trying to update a div on click similar to orkut .. The div is updating fine. But when the user clicks on the textbox its value becomes null initially. So the user has to again type the whole thing. So what I need is a facililty for the user to add the text with the existing one. So when he clicks on the textbox, the existing value of textbox would remain there and allows user to append new text. Please find the code below for that..</p>

<pre><code>$(document).ready(function () {

    $('.photo_title').click(

    function(e){

        var text = $(this).text();
        $(this).val('');

        $('&lt;input type="text" value="sdfsdfsdfsdf"    /&gt;').appendTo($(this)).val(text).select().blur(
            function(){
                var newText = $(this).val();
                    if(newText==""){newText="enter text "}

                $(this).parent().text(newText),find("form input:text" ).remove();

        });
    }); 
});
</code></pre>

<h1>   HTML</h1>

<pre><code>&lt;div class="photo_title"&gt;My text goes here and type here to add more&lt;/div&gt;
</code></pre>
