我使用jQuery創建一個錨點,並且在創建元素時觸發onclick事件。我已經使用this method這個項目幾次創建元素沒有問題,我得到了棒的錯誤結局?jQuery創建元素觸發onclick事件
jQuery('<a/>', {
href: '#',
name: 'link_html_edit',
id: 'link_html_edit',
html: 'input HTML text',
onclick: alert('test')
}).appendTo(spanDefaultValue);
感謝
*捂臉*沒想到的,謝謝。我會在T減11分鐘後接受 – piddl0r
@ piddl0r謝謝! :) – Paulpro