I have the following code , how can I check if this content is null with jquery ? Could anyone help to me ?
.append("<div class='form-group'><textarea rows='5' class='input-text full-width description' >"+data.pi.description+"</textarea></div>")
I have the following code , how can I check if this content is null with jquery ? Could anyone help to me ?
.append("<div class='form-group'><textarea rows='5' class='input-text full-width description' >"+data.pi.description+"</textarea></div>")
A bunch of different ways to check if content is null. Just by the data.pi.description:
if (! data.pi.description) ...
You could check the div text area with:
if (!$(".description").html()) ....
or
if ( $(".description").length == 0) ...
Similar question to How to check null objects in jQuery