AJAXをtable.tablesorter
使用して頻繁に変更される要素があります。ヘッダーをクリックするたびに要素にデリゲートする「クリック」にイベントハンドラーを追加したいと思います。私はjQueryを使用するのが初めてです。そこで、以下の jQuery スクリプトを Chrome Web Console に入れてみます。table.tablesorter th.class
jQuery スクリプト:
$('#table-content').on(
'click',
'.tablesorter thead tr th',
function() {alert(); }
);
私のHTML:
<div id="table-content">
<table class="tablesorter">
<thead>
<tr>
<th class="header">No.</th>
<th class="header">Name</th>
<th class="header">Phone</th>
</tr>
</thead>
</table>
</div>
結果: テーブルのヘッダーをクリックしてもアラート ポップアップ ウィンドウは表示されません。
テーブルのヘッダーをクリックしたときに警告ダイアログを表示するには、何を変更する必要がありますか?