In this case, the simplest thing is probably to use .find() to
"discover" the new element, i.e.:

$(this)
    .after('<input type="text" name="symptom" value="Enter Symptom"
class="focusClear" />')
    .parent()
    .find('input.focusClear')
    .focus(function(){
        $(this).val('');
    });


- jason




On May 1, 8:07 pm, jquertil <[EMAIL PROTECTED]> wrote:
> Hello...
>
> I'm creating an input element like this:
>
>         $(this).after('<input type="text" name="symptom"
>                           value="Enter Symptom" class="focusClear"/
>
> >');
>
> then I want to clear the value on focus like so:
>
>         $('.focusClear').focus(function(){
>                 $(this).val('');
>         });
>
> Obviously this doesnt work cine jquery doesnt know about the element
> yet. Do I need to write it as an extension?
>
> Thanks!

Reply via email to