JSFiddle - React, Tailwind, and code Playground

by mstefanko

HTML

<div id="comment_list">    trhrtrjrtjttrj     </div>

CSS

#comment_list {
    border: 1px solid black;
    height: 60px;
    width: 60px;
}

JavaScript

var html = $("#comment_list").html();
var comment_list = $.trim(html);
var hasComments = false;
if (comment_list != "") {
    hasComments = true;
}

//Show border if comments exist
//Change div height if comment exist
if(hasComments) {
    $("#comment_list").css("border","1px solid #969696");
    $("#comment_list").height("70%");
} else {
    $("#comment_list").css("border","0");
    $("#comment_list").height("80%");
}