0

html:

<input class="spinner1 ui-spinner-input" id="q1" name="value" value="1" min="1" aria-valuemin="1" aria-valuenow="5" autocomplete="off" role="spinbutton">

how to add an event on changing value of aria-valuenow?

jbduzan
  • 1,106
  • 1
  • 14
  • 30
Abdus Sattar Bhuiyan
  • 3,016
  • 4
  • 38
  • 72

1 Answers1

3

There is no Native way that is supported by all browsers to do this, you can check a look on Mutation_Events but it is not fully functional.

You can though, trigger a custom event on the item that is changing you custom attribute, and listen to this event to make needed changes :

$(document).on('custom-attribute-changes', function() {
    // listen to the data change and do what you need
  });

  $('#button').click(function() {

// trigger this event on any certain change that shall edit its value
    $(document).trigger('custom-attribute-changes');
  });
KAD
  • 10,972
  • 4
  • 31
  • 73