Search code examples
javascriptjqueryjquery-knob

How to get id of Jquery knob


I am using jquery knob,I want to get the id of the knob on change function.

$(".dial").knob({
  'min': 0,
  'max': 5,
  'readOnly': false,
  'width': 70,
  'height': 70,
  'dynamicDraw': true,
  change: function(value) {
    console.log("changed to: " + value);
  },
});
<input type="text" class="dial" value="2" id="test" disabled="disabled">

Thanks in advance


Solution

  • Try this.$.attr('id'); in the change function

    Check out the working FIDDLE LINK