Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
<!--[if IE]>
  <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<style>
  article, aside, figure, footer, header, hgroup, 
  menu, nav, section { display: block; }
  
  ul{list-style:none;}
  a{text-decoration:none;}
*{margin:0;paddding:0;}
  
  #result{
    background:#cf5;
  }
  
  div{margin:10px;}
  
  
  </style>
  
  </head>
 <body>
<div>
  
  <span id="span_1">i'm span 1</span> <br />
  <span id="span_2">i'm span 2</span> <br />
  <span id="span_3">i'm span 3</span>
  
  
</div>
   
   
<div>
  
  <span id="span_4">i'm span 4</span> <br />
  <span id="span_5">i'm span 5</span> 
  
</div>
   
   
   <div id="result"></div>
  
  
</body>
</html>
 
var listy = [];
    
$("div span[id]").each(function(){ 
  listy.push( this.id );  
});
$('#result').html(  listy.join()  );
Output 300px

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers