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

前端 未结 9 964
陌清茗
陌清茗 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 23:02

    Try this -

    $( "#security_question_1" ).change(function () {
        if($( "option:selected", this ).text()=="text you want to match"){
           $("#div-id").hide();
        }else{
           $("#div-id").show();        
        }
    });
    

提交回复
热议问题