Validating a radio button is checked with jQuery

前端 未结 7 1729
你的背包
你的背包 2021-01-13 07:17

On my form I havea set of radio buttons. Here\'s the mark up:

Format

7条回答
  •  时光取名叫无心
    2021-01-13 07:25

    You could check to see if the checked radio button name returns a value in jQuery:

    if($("input[@name='fileType']:checked").val() != null){
        // button checked
    }
    

提交回复
热议问题