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

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -