Hey,

I extended your example code to add a blur function.  You can add an
if statement in the blur function if you need to restore the default
only in certain cases (like only if $(this).val() == "")

$(document).ready(function(){
        $("#schnellsuche input")
             .focus(function () {
                    $(this).val("");
             })
             .blur(function() {
                    $(this).val("Schnellsuche");
             });


});

- Jamie Goodfellow



On Feb 15, 9:28 am, tlob <[EMAIL PROTECTED]> wrote:
> Hello
>
> I managed to do sucessfully:
>
> $(document).ready(function(){
>         $("#schnellsuche input").focus(function () {
>                         $(this).val("");
>         });
>
> });
>
> <form action="" id="schnellsuche">
> <input class="text" type="text" value="Schnellsuche" />
> </form>
>
> I'm so proud of me ;-)
>
> now I want the default value back in, when the focus is not anymore in
> the input textbox. Can someone put me in the right direction?
>
> thx

Reply via email to