jQuery radio button show div

前端 未结 4 703
余生分开走
余生分开走 2021-01-15 18:53

Hey guys, what function could I use to say, if this radio button is checked show this \'div\'. Thanks in advance.

4条回答
  •  有刺的猬
    2021-01-15 19:34

    $("myradiobuttonselector").change(function () {
      if ($(this).attr("checked")) {
        $("mydivSelector").show();
      }
      else {
       $("mydivSelector").hide();
      }
    });
    

提交回复
热议问题