4

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

BenG
  • 14,826
  • 5
  • 45
  • 60
user90
  • 63
  • 5

1 Answers1

3

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

Check out the working FIDDLE LINK

Abhinav
  • 8,028
  • 12
  • 48
  • 89
  • This is a great answer ... I'm wondering if you can explain "how" or "why" this works. I don't understand the syntax "this.$"? – Kolban Jun 26 '16 at 16:42
  • @Kolban : I am not sure..I actually went through their docs and got it by trial and error, I have neva used jquery knob myself – Abhinav Jun 27 '16 at 05:34