Hidden <label> element:

<label style="display:none" for="input">label</label>
<input id="input"/>


Hidden <span> within label <div>:

<div id="label">label <span style="display:none" id="innerSpan">this text shouldn't be part of the label</span></div>
<input id="input1" aria-labelledby='label'/>

label


Non-hidden <span> within label <div>:

<div id="label2">label <span id="innerSpan">this text shouldn't be part of the label</span></div>
<input id="input2" aria-labelledby='label2'/>

label this text shouldn't be part of the label


Hidden <span> referenced by aria-labelledby within a <div>:

<div id="label3">label <span style="display:none" id="innerSpan2">this text will part of the label even though it is hidden</span></div>
<input id="input3" aria-labelledby='label3 innerSpan2'/>

label


Hidden <label> referenced by aria-labelledby:

<label style="display:none" for="input4" id="labelEl">hidden text</label>
<input id="input4" aria-labelledby="labelEl"/>