여기 나는 그들이 엘리트 옵션을 선택한 경우에 따라 콘텐츠를 표시하기 위해 함께 넣어 가지고 무엇을 선택하지만, 코드의 밤은 그렇게 고정 어떤 도움이 좋을 것 제대로 작동디스플레이
<style>
.notelite{
display:none!important;
}
gotelite{
display:block!important;
}
</style>
<script language="javascript">
if(document.getElementById('profile_field_7_10').value == "4") {
document.getElementById('elitecontent').className="gotelite";
}
if(document.getElementById('profile_field_7_10').value == "1") {
document.getElementById('elitecontent').className="notelite";
}
if(document.getElementById('profile_field_7_10').value == "2") {
document.getElementById('elitecontent').className="notelite";
}
if(document.getElementById('profile_field_7_10').value == "3") {
document.getElementById('elitecontent').className="notelite";
}
if(document.getElementById('profile_field_7_10').value == "0") {
document.getElementById('elitecontent').className="notelite";
}
</script>
<span id="elitecontent" style="cursor:pointer;">Decor</span>
또한 편집 할 수없는 자신의 순위를 보여주는 실제 콘텐츠가 있습니다 ... 광산이 엘리트로 선택되었으므로 어떤 옵션이 선택되었는지 = "선택됨"에 따라 자바 스크립트를 어떻게 변경합니까?
<span id="your_div_id_level"><dd><div class="field_uneditable">Elite</div>
<div class="field_editable invisible"><select class="gensmall" id="profile_field_7_10" name="profile_field_7_10" size="1">
<option value="">No choice</option><option value="0">New Starter</option>
<option value="1">Junior</option>
<option value="2">Novice</option>
<option value="3">Pro</option
><option value="4" selected="selected">Elite</option></select></div></dd></span>
에
gotelite {
에서 CSS를 변경해야 즉'gotelite'의 .gotelite'instead 안 { ...'(후자는 클래스 대신 gotelite라는 이름으로 dom 요소를 처리합니다). –