0

次の JavaScript コードは FF と Chrome で動作しますが、IE のどのバージョンでも動作します。私が見つけることができる明らかなエラーはないようです。

どんな助けでも大歓迎です。

<script type="text/javascript">
// hide/expose  search_by2 to/from dates 
function hide_search_by2(that){
    selected_value = that.options[that.selectedIndex].value;

    if(selected_value == 'vehicles_sales.nodate'){
        document.getElementById("search_by2_from_row").hidden=true;
        document.getElementById("search_by2_to_row").hidden=true;  
    } else {
        document.getElementById("search_by2_from_row").hidden=false;
        document.getElementById("search_by2_to_row").hidden=false;  
    }
}
</script>
4

1 に答える 1

1

何が隠されていますか?

要素を非表示にする場合は、displayをnoneに設定します。

隠れる

document.getElementById("search_by2_from_row").style.display = "none";

公演

document.getElementById("search_by2_from_row").style.display = "inline";  //or "block"

または可視性

隠れる

document.getElementById("search_by2_from_row").style.visibility = "hidden";

公演

document.getElementById("search_by2_from_row").style.visibility = "visible";  
于 2012-11-07T00:42:58.040 に答える