How to show/hide DIV on selection of ANY drop-down value?

前端 未结 9 936
陌清茗
陌清茗 2020-12-10 22:18

I have found many answers to the question:

How do I show/hide DIV on selection of \"Other\" dropdown value.

However I cannot fin

9条回答
  •  春和景丽
    2020-12-10 22:42

    add the following function to the onchange,

    function showHide(value) {
        if (value=='')
            document.getElementById('divShow').style.display = 'none';
        else
            document.getElementById('divShow').style.display = 'block';
    }
    

    and set the display style of the div (which is needed to hide/shown) to none initially. Check demo here

提交回复
热议问题