<div id="a"> <div></div> <div></div> <div></div> <div></div> <p id="b"></p> </div>
<script> b=document.querySelector(‘#b‘); a=document.querySelector(‘#a‘); console.log([].indexOf.call(a.children,b)); console.log([].indexOf.bind(a.children,b)()) </script>