I am trying to determine if a textarea is empty if a user deletes what is already pre-populated in the textarea using jQuery.
Anyway to do this?
This is what
This will check for empty textarea as well as will not allow only Spaces in textarea coz that looks empty too.
var txt_msg = $("textarea").val(); if (txt_msg.replace(/^\s+|\s+$/g, "").length == 0 || txt_msg=="") { return false; }