I think I need to amend the document.createElement("OPTION") to something like document.createElement("checkbox") but I am not sure and I do not know what else to amend in the code.
Or if someone can show a simple way to create checkboxes dynamically it would be a start.