我想不通爲什麼jQuery的功能將無法使用HTML這裏 JS小提琴工作:http://jsfiddle.net/JonaTheApprentice/E89rg/什麼導致我的jQuery功能無法運行?
function addItem() {
$('#list').append('<li><input type="checkbox" /> item</li>');
}
function removeItem() {
$('#list').children().filter(function() {
return this.firstChild.checked;
}).remove();
}
你沒有#list在你的HTML – Huangism
你不必與list'的'在你的HTML標識的任何元素。另外,您不應該使用內聯事件處理程序。 –
@minitech我不明白這個問題是怎麼回事,當有多個人在解決這個問題。 –