SHARE
TWEET

Untitled

a guest Jun 24th, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $(document).ready(function(){
  2.   var clases = [];
  3.   var parent = $("body");
  4.   var divs = parent.children();
  5.  
  6.   for(var i = 0; i < divs.length; i++){
  7.  
  8.     clases.push(divs[i].className)
  9.   }
  10.  
  11.   console.log(clases);
  12.  
  13. });
  14.      
  15. <body>    
  16.     <div class="Clase_1 Clase_12"></div>
  17.     <div class="Clase_2"></div>
  18.     <div class="Clase_3"></div>
  19. </body>
  20.      
  21. (3) ["Clase_1 Clase_12", "Clase_2", "Clase_3"]
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top