Hello, I'm trying to use Java Script in appgyver but it's not working I would like some help

Hello, I’m trying to use Java Script in appgyver but it’s not working I would like some help

selected input where I want by value from back to front for price in product

const inputField = document.querySelector('#my-input');

inputField.addEventListener('input', (event) => {
  const value = event.target.value;

  if (/^\d{0,2}(\d{0,2}([,.])?)?(\d{0,2}([,.])?)?(\d{0,2}([,.])?)?(\d{0,2}([,.])?)?(\d{0,2}([,.])?)?$/.test(value)) {
    const reversedValue = value.split('').reverse().join('');
    const formattedValue = reversedValue.replace(/(\d{2}(?!$))/g, '$1,').split('').reverse().join('');

    event.target.value = formattedValue;
  }
});


if someone can teach me how i put this java script in my input

thank you for your attention

What are you trying to achieve with this function?
Check this post for how to pass the data into your function.