// 向上移动题目选项 function up(obj) { let objParentTR = $(obj).parent().parent(); let prevTR = objParentTR.prev(); if (prevTR.length > 0) { prevTR.insertAfter(objParentTR); } } // 向下移动题目选项 function down(obj) { let objParentTR = $(obj).parent().parent(); let nextTR = objParentTR.next(); if (nextTR.length > 0) { nextTR.insertBefore(objParentTR); } }
原文:https://www.cnblogs.com/hard-working-Bert/p/14606157.html