Hide a div if content is empty

前端 未结 3 1259
醉梦人生
醉梦人生 2020-12-15 12:19

Philosophy bubble is like a quote/speech bubble div styled which has a sharepoint control inside, the richHtmlField which lets users to type in content while editing page, b

3条回答
  •  清歌不尽
    2020-12-15 13:00

    Something like:

    if ($('.philosophy-bubble').is(":empty")){
        $('.philosophy-bubble').hide();
    }
    

    here is a fiddle: http://jsfiddle.net/IrvinDominin/XYr9T/1/

    EDIT

    better by using:

    $('.philosophy-bubble:empty').hide()
    

    http://jsfiddle.net/IrvinDominin/XYr9T/3/

提交回复
热议问题