How to only show input fields if checkbox is checked?

前端 未结 6 2359
小鲜肉
小鲜肉 2021-01-02 12:40

Basically, I want to only show these fields if checkbox is selected, if it becomes unselected, disappear.



        
6条回答
  •  梦谈多话
    2021-01-02 13:35

    Pointy pointed out that you need to set the id of our checkbox (or use a name selector). You also need to use #date (id) instead of .date (class) (or again change the HTML).

    Working demo

提交回复
热议问题