Answers for "if div contains children"

1

check if an HTML element has any children

if (element.hasChildNodes()) {
    // It has at least one
}
Posted by: Guest on May-20-2021
-1

if element not has children

^ null
Posted by: Guest on June-08-2021

Code answers related to "if div contains children"

Code answers related to "Javascript"

Browse Popular Code Answers by Language