私は次の機能を持っています:
if ($(this).find('#sel').length == 0) {
var before = $(this).text();
var title_id = $(this).parent().attr('id');
$(this).html("<select id='sel' onchange='selectdone(this, title_id=title_id)>
...</select>");
}
これから私は得Uncaught ReferenceError: title_id is not defined
ます。onchange
4 行目の内部の関数が、以前に定義した変数を取得しないのはなぜですか? 上記を正しく書き直すにはどうすればよいですか?