我正在使用 jquery knob
,我想在更改函数时获取旋钮的 id
。
$(".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">
提前致谢
最佳答案
在 change
函数中尝试 this.$.attr('id');
检查工作 FIDDLE LINK
关于javascript - 如何获取 Jquery 旋钮的 ID,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31219318/