Show/Hide multiple DIVs with Select using jQuery

前端 未结 4 1702
孤城傲影
孤城傲影 2020-12-15 11:49

I essentially have the same situation as the person in the following question:

Link: how to show/hide divs by select.(jquery)

Through extensive searching wit

4条回答
  •  眼角桃花
    2020-12-15 12:38

    Swap show/hide so that it looks like this:

    $('#divarea1')[ ($(this).val() == 'area1') ? 'show' : 'hide' ]()
    

提交回复
热议问题