How can create a Pyramid program by loop and switch function?

Hi Friends,

Please take a look on given codes and find out where I have committed any mistake. Actually I have created 5 buttons and trying to display a pyramid after clicked on button. I am using a javascript function which is catching value. Can you please suggest how can i use switch function with this program.

<html>
<head><title></title>
<script language=“javascript”>
function display(num)
{
var i;
for(i==1;i<=num;i++)
{

document.write("");
document.write("<br>");
document.write("
,");
document.write("<br>");
document.write("
,,");
document.write("<br>");
document.write(",,,,");
document.write("<br>");
document.write(",,,,");
document.write("<br>");
document.write("
,,,,,");
document.write("<br>");
document.write("
,,,,,,");
document.write("<br>");
document.write(",,,,,,,");
document.write("<br>");
document.write(",,,,,,,,*");

}
}

</script>
</head>
<body>
<form>
<input type=button name=“pramind1” onclick=“display(5)” value=“Pramind 5”>
<input type=button name=“pramind1” onclick=“display(6)” value=“Pramind 6”>
<input type=button name=“pramind1” onclick=“display(7)” value=“Pramind 7”>
<input type=button name=“pramind1” onclick=“display(8)” value=“Pramind 8”>
<input type=button name=“pramind1” onclick=“display(9)” value=“Pramind 9”>
<input type=button name=“pramind1” onclick=“display(10)” value=“Pramind 10”>

</form>
</body>
</html>

Your any comments will appreciate us.

Thanks,
www.gojijuiceinfo.org