> $('form#myform [EMAIL PROTECTED]').val('please enter > here').click(function() { > if (this.value == 'please enter here') this.value = ''; > });
The downside to changing the value attribute is that the "please enter here" text will be submitted with the form if the user doesn't enter any value before submitting. You can use some validation javascript to look for the values and display an error message. Or, you could use something like the overlabel plugin, which places the prompt above the form element without changing the value. http://scott.sauyet.com/thoughts/archives/2007/03/31/overlabel-with-jquery/