How do I add a javascript event to an input on my landing page?

Hi! I’m trying tu run a script on my landing page to validate the chilean ID, but I need to add an event to the input (onkeypress=“return isNumber(event)” oninput=“function(this)”).

Has anyone done this or have any recommendations?