获取下一个元素next $('#txtName').next().attr('id') $('#txtID').parents('div').next('div').find('input:first').attr('id')