Home » Categories » jQuery

How to apply style to parent if it has child with CSS?

 

$('ul li:has(ul.child)').addClass('has_child');


Ref:
https://www.geeksforgeeks.org/how-to-apply-style-to-parent-if-it-has-child-with-css/

 

Article Rating (No Votes)
Rate this article
  • Icon PDFExport to PDF
  • Icon MS-WordExport to MS Word
 
Attachments Attachments
There are no attachments for this article.
Comments Comments
There are no comments for this article. Be the first to post a comment.
Related Articles RSS Feed
Attribute Contains Selector [name*=”value”]
Viewed 876 times since Wed, Sep 30, 2020
How to get Response Header location from jQuery Get?
Viewed 735 times since Wed, Sep 30, 2020
Hidden image after redirect by check filename
Viewed 612 times since Wed, Sep 30, 2020
jQuery multiple events to trigger the same function
Viewed 579 times since Mon, Sep 28, 2020