레이블에서 라디오 버튼과 그 옆에있는 텍스트를보다 사용자 친화적으로 포장해야합니다.요소 옆에있는 텍스트를 선택하십시오 (거의)
며칠 전에 비슷한 문제가 발생했습니다. 여기에는 확인란이 있으며 스팬 요소가있는 직후입니다. 그리고 두 요소를 모두 감쌀 수 있습니다. 내가 페이지를 생성하는 도구를 사용할 때
<span class="Attribute">
<input type="radio" name="vMONHRDREM" value="S">
<script type="text/javascript">gx.dom.setAttribute("vMONHRDREM","gxoch0","if(!(gx.evt.jsEvent(this))) return false;");</script>
Ativado
<input type="radio" name="vMONHRDREM" value="N">
<script type="text/javascript">gx.dom.setAttribute("vMONHRDREM","gxoch0","if(!(gx.evt.jsEvent(this))) return false;");</script>
Desativado
</span>
불행하게도, 나는 HTML 구조를 변경할 수 없습니다 :
나는이 HTML이있다.
$("input[type=radio]").each(function(){
alert($(this).next().next().text());
});
을하지만 그것은 작동하지 않습니다 :
나는 이런 식으로 뭔가를 시도하고있다. 아무것도 반환하지 않습니다. $(this).next().text()
으로 변경하면 스크립트 텍스트가 표시됩니다.
업데이트 : 최종 솔루션.
$('.Attribute input[type="radio"]').each(function() {
$($(this).next('script')[0].nextSibling).wrap("<span />");
$(this).addBack().add($(this).next('script')[0].nextSibling).wrapAll('<label></label>')
});
들 덕분에
입력 요소는 텍스트 내용이없는
감사합니다. 정확히 무슨 뜻이야! 둘 다 감사드립니다! – lcssanches