jquery - need to check textarea if nothing typed or defaultValue -


i trying check inside textarea if there nothing typed or default value exist code:

 if ($("#ipt-content").val() == '' && $("#ipt-content").val() == defaultvalue) {         $("#ipt-content").addclass("ipt-error");         valid = false;         emptyfields = true;     } else {         $("#ipt-content").removeclass("ipt-error");     } 

unfortunately code doesn't work. can please me guys?

if default value line , condition required || ( logical or ) change code below :

 var defaultvalue="line";   if ($("#ipt-content").val() == '' || $("#ipt-content").val() == defaultvalue) {         $("#ipt-content").addclass("ipt-error");         valid = false;         emptyfields = true;     } else {         $("#ipt-content").removeclass("ipt-error");  } 

Comments

Popular posts from this blog

matlab - Deleting rows with specific rules -

php - MySQLi multi_query results for later use -