2012-02-15 54 views
-3

當用戶選擇「範圍」時,我試圖使標籤「until」出現。但標籤沒有出現。 這些是我的代碼。用於顯示標籤的Java腳本

  <td><select onchange="Show(this,'vin','until1');" 
     <option value="less">Less than</option> 
     <option value="more">More than</option> 
     <option value="range">By range</option> 
     <option value="is">Is anything</option> 
     </select> 
    </td> 
    <td width="145"><input id="vin" style="visibility:hidden;" type="text"></td> 
    <td width="145"><label id="until1" style="display:none;"> until </label> </td> 

    txt=obj.options[obj.selectedIndex].value; 
    if (txt.match('range')){ 
    document.getElementById(un).show();} 

感謝

+1

該標籤缺少'for'屬性。 – Quentin 2012-02-15 10:02:43

+1

你需要告訴我你的「顯示」方法。 – 2012-02-15 10:02:45

回答

1

show()方法是jQuery中沒有在JavaScript ..嘗試這個

document.getElementById(un).style.display = 'block'; 

或情況visibility

document.getElementById(un).style.visibility = 'visible'; 
+0

謝謝...我試過使用可見和它的工作...順便說一句,謝謝你的建議 – tqa 2012-02-15 10:11:34

0

反而顯示的(),做style.display ='block'