So I already have the code:
function addOpt(opti, id) {
document.getElementById("options").appendChild(document.createTextNode(opti))
// ID WILL BE USED LATER
}
but I now want to make it so that when you click on the text (opti) it runs a function.