Sign in
Log inSign up

Is it possible to make 1 efficient jQuery selector which will return only the p elements indicated in the HTML as well as any additional p elements that might be added after the last one?

Rhami Aboud's photo
Rhami Aboud
·May 10, 2017
<p>...</p>  
<section>    
    <p>...</p>    
    <h2>...</h2>    
    <p>This paragraph should be selected</p>    
    <div>      
        <p>...</p>    
    </div>    
<p>This paragraph should be selected</p>  <!--<p>Additional tag which might be added and would be picked up by the selector</p>-->  
</section>
Hassle-free blogging platform that developers and teams love.
  • Docs by Hashnode
    New
  • Blogs
  • AI Markdown Editor
  • GraphQL APIs
  • Open source Starter-kit

© Hashnode 2024 — LinearBytes Inc.

Privacy PolicyTermsCode of Conduct