Javascript examples for DOM HTML Element:Style
Select in each row the last element with CSS Selector class
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){//w w w . j a v a 2 s. c om console.log( document.querySelector( ".child:last-of-type" ) ); } </script> </head> <body> <div class="parent"> <div class="child"> 1 </div> <div class="child"> 2 </div> <div class="child"> 3 </div> </div> </body> </html>