在 <dl> 列表的 <dt> 後動態添加 <input> 文本框。
document.getElementById('targetDt').insertAdjacentHTML('afterend',
'');
insertAdjacentHTML('afterend', html) 比操作 innerHTML 更高效、不破壞現有事件綁定。
const dt = document.getElementById('targetDt');
const input = document.createElement('input');
input.type = 'text';
input.className = 'dynamic-input';
input.placeholder = '請輸入';
dt.parentNode.insertBefore(input, dt.nextSibling);
dt 後已有 dd,插入位置需調整dl 或 document)