Check if the radio channel is selected.

I use a little show and hide the logic.

I want to show the payment button, but only after the "package type" is selected.

I just can't get this to work.

My HTML code is as follows:

<label class="checkbox inline">
  <img src="http://local.halo-smart/assets/img/icons/icon-package-one.png">
  <input type="radio" title="69" value="package1" name="bikes[]1" 
                      class="radio-price"> 
</label>

How can I check if this is selected?

Thanks in advance.

+3
source share
1 answer

use selector :checked

$("input[name='bikes[]1']").is(':checked')

The above code will return trueif the switch is selected and vice versa.

+3
source

All Articles