javascript - jQuery: Search for div containing specific mark up -
i'm stuck editor outputs <p><br></p> when textfield empty , want target divs none content.
i've been trying .filter, text lengths, :contains, .html , not can't seem find way <div> contains mark up.
other <div> may contain , text normal , fine, need target code below specifically.
<div> <p> <br> </p> </div> any idea how approach this?
try this...
var $div = $("div").filter(function() { return this.innerhtml.replace(/\s+/g, '').tolowercase() == "<p><br></p>"; }); the resulting object ($div) jquery collection of divs you're interested in.
Comments
Post a Comment