這裏是我已經把基礎上,如果他們有精英選項中選擇要顯示的內容,但代碼心不是合適的工作,所以一些幫助修復將是巨大的......顯示選定
<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>
這裏還有顯示他們排名的實際內容,我無法編輯......我被選爲Elite,所以如何根據選擇哪個選項=「選擇」來更改javascript?
<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 .gotelite'instead { ......「(後者將用」gotelite「這個名字代替一個類來解決dom元素)。 – 2014-09-20 18:51:25