$(".problem-modify").dragsort({ dragSelector: "i", placeHolderTemplate: "
  • " }); $('.modify-option').click(function() { $('.option-box,.modify-option').hide(); $('.modify-box').show(); $('.problem-modify').html(''); $('.option-box li input').each(function(i) { var a = $(this).attr('title'); var data=$(this).attr('data'); if(data=='add'){ $('.problem-modify').append('
  • ×
  • '); }else{ $('.problem-modify').append('
  • '); } }) }) $(document).on('click','.close',function(){ $(this).parents('li').remove(); }) $('.add').click(function() { $('.problem-modify').append('
  • ×
  • '); }) $('.preservation').click(function() { var a = true; $('.problem-modify li input').each(function(i) { var thisVal = $(this).val(); if(thisVal == '') { $(this).css('border-color', 'red'); a=false; }else{ $(this).css('border-color', '#ccc'); } }) if(a==true){ $('.option-box').html(''); $('.option-box,.modify-option').show(); $('.modify-box').hide(); $('.problem-modify li input').each(function(x) { var thiText = $(this).val(); var data=$(this).attr('data'); if(data=='add'){ $('.option-box').append('
  • '); }else{ $('.option-box').append('
  • '); } }) } if(a == 0) { alert('公司职能不能为空') } })