如何通过"for"属性更新Prototype中<label>的innerHTML?

cel*_*owm 1 html label innerhtml radio-button prototypejs

我有一个框架生成这个无线电,如何更新标签whithout id但"for"属性的"asa"文本?

<input type="radio" value="questao1" id="SimuladoQuestao1">
        <label for="SimuladoQuestao1">asa</label>
Run Code Online (Sandbox Code Playgroud)

谢谢,塞尔索.

erl*_*ndo 6

Prototype有一个非常强大的选择引擎.这是一种方法:

$$('label[for="SimuladoQuestao1"]').first().update('New label')
Run Code Online (Sandbox Code Playgroud)

详情请见此处