In jQuery, we can use the direct descendant selector > $(‘#test-id > p:first’) or even children() $(‘#test-id’).children(‘p’).first()
jQuery find first child element of type
1 Article
1
Professional Technical Solution Services for Adobe Commerce/Magento 2
In jQuery, we can use the direct descendant selector > $(‘#test-id > p:first’) or even children() $(‘#test-id’).children(‘p’).first()