seema patil
seema patil

Reputation: 61

How do I check jQuery uncheck radio button?

Hello I'm using following for checked of radio button and remove class now I want to apply same for unchecked and addClass what is changes is my following jQuery line for unchecked radio?

$("#address_show:checked").closest('.display_address').find('.ps-btn-show-address').removeClass('hide_address');

Upvotes: 1

Views: 29

Answers (1)

Or Assayag
Or Assayag

Reputation: 6336

Try:

if ($("#address_show:not(:checked)") {
 // Do what you want here.
}

Upvotes: 1

Related Questions