I am trying to create a game board for Barricade but I am failing with the first step, creating a simple grid of circles before specifying which circles are visible.
Should I draw it with a canvas?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Boardgame</title>
<style type="text/css">
.circleBase {
-webkit-border-radius: 999px;
-moz-border-radius: 999px;
border-radius: 999px;
behavior: url(PIE.htc);
}
.type1 {
width: 30px;
height: 30px;
background: yellow;
border: 3px solid red
}
</style>
<script type="text/javascript">
function genDivs(){
var v = 10;
var e = document.body;
for(var i = 0; i < v; i++)
{
var row = document.createElement("circleBase type1");
for(var x = 1; x <= v; x++)
{
var cell = document.createElement("circleBase type1");
//cell.innerText = (i * v) + x;
row.appendChild(cell);
}
e.appendChild(row);
}
document.getElementById("code").innerText = e.innerHTML;
}
</script>
</head>
<body>
<input type="button" onclick="genDivs()" value="click me">
</body>
</html>