<html>
<head>
<title>example</title>
</head>
<body>
<input type="button" id="tower1" value="click me">
<script>
var tower1 = document.getElementById('tower1');
tower1.onclick = build('tower1');
function build(tower)
{
return function ()
{
document.getElementById(tower).disabled = 'true';
}
}
</script>
</body>
</html>