Initiating javascript on static event focus on text input

I seem to have forgotten how to do this and need some reminding please :slight_smile:

I have a multi step form with sections hidden as conditional regions.

Therefor when the page loads these sections aren’t available to target using javascript.

I am using number-separator.js successfully on another page where regions aren’t hidden on load.

The js file is included and the following script added to the page.

<!-- This code attaches the easy comma separator to a class -->
<script>
    easyNumberSeparator({
    selector: '.number-separator',
    })
</script>

I want to run the js function on focus static event when the user focuses on the field.

just using easyNumberSeparator() does not work.

If I remember correctly I must put this function inside a named function, but cannot remember the syntax.

Anyone can helkp with this please and thanks?

Community Page
Last updated: