<script>; <BR>$.schoolFn = { <BR>addItem: function(obj){ <BR>$("#itemList").append("<li id='liItrm' class='list-group-item clearfix' > <span class='glyphicon glyphicon-resize-vertical sort-handle'>" obj"<輸入隱藏型別='' name='audiences' value='" obj "'> <button type='button' class='close delete-btn deleteItem' onclick='deleteItem(this);' title='刪除'>×"); <BR>}, <br><br>removeItem: function(obj){ <BR>$("#" obj).replaceWith(""); <BR>} <BR>} <BR>$("#itemAdd").click(function(){ <BR>var item=$('#teacherInput').val(); <BR>$.schoolFn. addItem(item); <BR>$('#teacherInput').val(""); <BR>}); <BR>function deleteItem(obj){ <BR>var item=$(obj).parents(".list-group-item").attr("id"); <BR>$.schoolFn.removeItem(item); <BR>} <BR></腳本> <BR></script>