Below Answer Will Select First 'a' Element under element With ID - 'id1" ( As per Asked in Question )
$('#id1 a:first-child').attr('id')
Below Code will only Select First Div with ID - 'id1' So it will select that div not child element of div ( But its not as per asked by question in answer )
$('#id1:first-child').attr('id')