```js
    var show=[
    "p1",
    "p2",
    "p3"
    ];
    var n;
    function show(n){
        for(n=1;n<=3;++n){

    document.getElementById("show").innerHTML=show[n];
        }
    }
```

```html
<button onclick="show(1)">b1</button>
    <button onclick="show(2)">b2</button>
    <button onclick="show(3)">b3</button>

    <p id="show"></p>
```

I am trying to print p1,p2,p3 when I click b1,b2,b3 respectively. How can I do it.