Skip to content
Advertisement

How do you get the wider context HTML that wraps a given selector code in jQuery or Cheerio js?

How do you get the entire HTML of h1 + ul > li > details > summary + p only if it has that structure? i.e. it wouldn’t get the HTML of a ul tag element if it doesn’t have a nested li, details etc.

JavaScript
JavaScript

Advertisement

Answer

Like this?

JavaScript
JavaScript
JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement