Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
 <script>   
   var i = 0;
function increase(place) { 
  console.log(place);
    addToDilly(i,place);
    i++;
}
function addToDilly(num,place) {
    if(num == 0) {
        document.getElementById("firstStop").innerHTML = document.getElementById(place).innerHTML;
}
    if (num == 1) {
        document.getElementById("secondStop").innerHTML = document.getElementById(place).innerHTML;
    }
    if (num == 2) {
        document.getElementById("thirdStop").innerHTML = document.getElementById(place).innerHTML;
    }
}
</script>
 
<p id="firstStop">This is a paragraph.</p> 
<p id="secondStop">This is another paragraph.</p>
<p id="thirdStop">This is another paragraph.</p>
<hr/>
<b id="1">Royal Oak </b><button onclick="increase('1')">Add To Dilly</button></br>
  <b id="2">Ferndale </b><button onclick="increase('2')">Add To Dilly</button></br>
  <b id="3">Chesterfield</b> <button onclick="increase('3')">Add To Dilly</button></br>
</body>
</html>
Output 300px

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

Dismiss x
public
Bin info
xxbinxxpro
0viewers