100% Percentage splitted at the number of checked boxes using javascript
<p>I have a list of costs for a building (buildings are generated on the fly with PHP from a db):</p>

<pre><code>Building
[ ] Susilo 2A-13
[ ] Susilo 2A-12
</code></pre>

<p>I want it to look like this</p>

<pre><code>Building
[ ] Susilo 2A-13 (0%)
[ ] Susilo 2A-12 (0%)
</code></pre>

<p>when nothing selected, and like this:</p>

<pre><code>Building
[x] Susilo 2A-13 (100%)
[ ] Susilo 2A-12 (0%)
</code></pre>

<p>and also 50% 50% when both selected. Also when 3 buildings showed it should show 33% 33% 33%. How should I do this?</p>

<p>Btw html is simple:</p>

<pre><code>Building&lt;br /&gt;
&lt;input type="checkbox" name="6" value="6"&gt; Susilo 2A-13&lt;br /&gt;
&lt;input type="checkbox" name="7" value="7"&gt; Susilo 2A-12&lt;br /&gt;
</code></pre>

<p>The problem is that those checkboxes are generated on the fly and it's not a constant number.</p>
