How to make a function run when a choice is selected when the choices were made with javascript?

I have a function that will make a message with choices appear on the screen, but I can't figure out how to run a function/do anything when they are pressed.


Code: 

Spoiler
function runTheNotes(ot){

var oEvent = $gameMap.event(ot.eventId());
var oEventDetail = oEvent.event();
var oNote = oEventDetail.note;
var nNote = JSON.parse(oNote);

console.log(nNote);

$gameMessage.add("What do you do?");
choices = [];
$gameMessage.setChoices(choices, 0);
choices.push("NumberOne");
choices.push("NumberTwo");


}



If anyone knows how/has any ideas they would be very welcome.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-make-a-function-run-when-a-choice-is-selected-when-the-choices-were-made-with-javascript.68132/