jQuery divas 특정 인덱스로 삽입 내가 가지고 있다고 가정해 보겠습니다. 1 div:nth-child(" + (i) + ")").after("great things"); } 편집: NaN 오류를 방지하기 위해 n번째 자식 선택기에 괄호를 추가했습니다.@hof나윌리 function insertAtIndex(i) { if(i === 0) { $("#controller").prepend("okay things"); return; } $("#controller > div:nth-child(" + (i) + ")").after("great things"); } window.doInsert = function(){ insertAtIndex(2); } Item 1 Item 2 Item 4 Item 5 Ins..