text() is used to get the innerHTML, stripped of tags, of an element. However, textarea has no innerHTML per se and instead has a "value" property. So that's why you need to use .val(). text() will work until the textarea's value gets changed (either manually or programmatically) which is why it "sometimes" works and sometimes doesn't.