ここで、ラベル ID を見つけて ID を選択したいのと同じ方法で、テキスト ID を見つけることができます
$('input[type="text"]').focus(function () {
var id = $(this).attr('id');
$('#' + id).draggable({ cancel: true });
});
ここで、ラベル ID を見つけて ID を選択したいのと同じ方法で、テキスト ID を見つけることができます
$('input[type="text"]').focus(function () {
var id = $(this).attr('id');
$('#' + id).draggable({ cancel: true });
});
フォーカス イベントはラベル用ではないため、マウス エンターをラベル フォーカス イベントに使用できます。
$('label').mouseenter(function () {
var id = $(this).attr('id');
$('#' + id).draggable({ cancel: true });
});
選択用
$('select').focus(function () {
var id = $(this).attr('id');
$('#' + id).draggable({ cancel: true });
});