var dayNumberCell = doc.createElement('td');
dayNumberCell.className = 'days_link';
dayNumberCell.setAttribute('onclick', function(scope) {
var bindScope = function() {
scope.changeDate(this, this.id);
scope.returnDate(scope.month, scope.year);
};
return bindScope;
}(this));
上記のコードは、tdsonclickイベントリスナーを生成します。生成されたコードは次のようになります
<td class="days_link" onclick="function () {
scope.changeDate(this, this.id);
scope.returnDate(scope.month, scope.year);
}">15</td>
TDをクリックすると、構文エラーメッセージが表示されます。指定されたコードが実行され、構文エラーがない関数をどのように記述すればよいですか。
前もって感謝します。