There are two elements "a", "b". In my script, I get the element "a", I need to get "b", which is a child.

<style> #a #b { background:blue; } </style> <script> var x = document.getElementById("a"); </script> 
  • with jQuery: x.find('#b'); . If b is a child, then x.children('#b'); - cyadvert

1 answer 1

x.children is an array of all children.