This piece of Javascript will calculate the result of an election conducted using closed list voting. The result is calculated using the d'Hondt method. After performing the calculation it will display a summary of the result, with the option to view pie charts showing the percentage of votes and seats by candidate, a table showing the allocation of seats from votes and a detailed explanation of the count.