Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="//code.jquery.com/jquery-2.1.1.min.js"></script>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
  
<ul id="list"></ul>
  
</body>
</html>
 
#list,
#list2{
  position:absolute;
  width:200px;
  float:left;
}
 
$(function() { // DOM ready shorthand
  
  var n = parseInt(prompt("Enter a Number"), 10), li = "";
  
  for(var i=1; i<=n; i++)
    li+="<li>"+( (i%3?"":"ping") + (i%5?"":"pong") || i )+"</li>";
  $("#list").html(li.replace(/gp/g,"g-p"));
});
Output

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

Dismiss x
public
Bin info
roXonpro
0viewers