<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+"<input type='hidden' 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></script>