updatepanel
に置かれているページに2つのaspラジオボタンがあります。私はこのようなjQueryを使ってクリックイベントを書いた:
$(document).ready(function() {
$(".inputs").click(function() {
alert($(this).id);
});
});
しかし、それは未定義を返します。何が問題ですか?
EDIT:
alert(" or " + $(this).attr("id"));
alert(this.id);
これらの2行は、null
を返します。
(にconsole.logを使用)。それはずっと簡単だろう。あなたの例では、以下を使用できます:console.log(this); – Min2liz