user90
user90

Reputation: 63

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

Upvotes: 4

Views: 546

Answers (1)

Abhinav
Abhinav

Reputation: 8168

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

Check out the working FIDDLE LINK

Upvotes: 3

Related Questions