Search code examples
alpacajs

How to add data- attributes to a field in alpacajs?


I am using alpacaJs 1.5.23.

I need to add data-(like data-target) attributes to my fields. Is there a way?


Solution

  • Yes you can do this by using data property in options object of your alpaca configuration like this:

    "data": {
       "target": "test value"
    }
    

    enter image description here

    here's a working fiddle for this.