radio button enable and requerd in jquery 1

radio button enable and requerd in jquery

Male
Female
$("#myButton").click(function(){ $("#myDiv").find("input").removeAttr("disabled"); })

Here is what the above code is Doing:
1. We have a div with an id of myDiv.
2. Inside the div, we have a radio button with a name of sex and a value of male.
3. The radio button is disabled.
4. Outside the div, we have another radio button with a name of sex and a value of female.
5. We have a button with an id of myButton.
6. When the button is clicked, the code finds the radio button inside the div and removes the disabled attribute.

Similar Posts