Dot Voting system in javascript