js上下移动table中的tr

        // 向上移动题目选项
        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);
            }
        }

 

js上下移动table中的tr

上一篇:解决 Could not locate installed application


下一篇:【力扣leetcode】-1480. 一维数组的动态和