Reputation: 8385
I have the following code below and it shows the resp
but if I delete the value from the input. Is there a way that I can clear the class when the input is deleted?
Code:
{
if (resp == '') { }
else {
$(".error").text(resp);
}
},
error: function (resp) {
console.log(data);
}
Invoke:
$(document).ready(function () {
$('.postForm').on('blur', '#post_title', function (e) {
$(".postForm #post_url_link").blur();
});
function postTitleCheck() {
$(".postForm #post_title").blur();
}
});
Upvotes: 0
Views: 46
Reputation: 10378
if(!resp)
{
$(".error").text('');// here set blank if no response
}else{
$(".error").text(resp);// here set response if it comes
}
Upvotes: 1