Search code examples
jquerytextarealivefocusout

JQuery Live Change FocusOut Events For TextArea Not Firing


cannot seem to find a way to get change or focusout to fire for a input type of textarea, tried a lot of different things and nothing is working thus far... this is my current iteration that does not work either...

I am using latest jquery release.

$('input[type="text"],input[type="textarea"]').live(
     'change focusout', function (e) 
    {
        debugger;
        alert('text area');
    });

Solution

  • Description

    Textarea is not an input element, it is a textarea ;) Check out my sample and this jsFiddle Demonstration

    Sample

    Html

    <input type="text"/>
    <textarea></textarea>
    

    jQuery

    $('input[type="text"], textarea').live(
         'keyup focusout', function (e) 
    {
        alert(this.tagName);
    });
    

    More Information

    Update

    I don't know if that is what you want but it looks like you want the event fired if the value is changed or the focus is lost. My sample and jsFiddle is updated.