I´m trying to get the data-io
attribute from my function.
<input id="42297" class="edit flatpickr-input active" data-io="in" value="14:23" type="text" readonly="readonly">
onChange: function(selectedDates, time, instance){
With this code i can get my input id threw: instance.input.id
But i cannot figure out how to access the data-io
attribute.
I´ve tried:
instance.input.data-io
instance.input.data('io')
instance.input.attr('data-io')
instance.input.attr('io')
How should i do?
Use instance.input.dataset.io
. More information about data-* attributes here:
https://developer.mozilla.org/en-US/docs/Learn/HTML/Howto/Use_data_attributes