Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Devops
  3. Question
Devops

Find out if radio button checked with JQuery?

Asked by Yash Raj Jul 1, 2021 1.2K views 1 answer
Share

About this question

I can set a radio button to checked fine, but what I want to do is set up a sort of 'listener' that activates when a certain radio button is checked.

Take, for example, the following code:

$("#element").click(function()
{ 
    $('#radio_button').attr("checked", "checked");
});

it adds a checked attribute and all is well, but how would I go about adding an alert. For example, that pops up when the radio button is checked without the help of the click function?

Your answer

1 Answer

More Devops discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest DevOps Blogs

Guides, tips and career advice on DevOps from JanBask experts.