jQuery: Check/uncheck a checkbox input or radio button
jQuery core : Exercise-5 with Solution
Check/uncheck a checkbox input or radio button.
Sample Data :
<body> <form action=""> <input type="radio" name="sex" value="male" checked>Male<br> <input type="radio" name="sex" value="female">Female </form> </body>
Solution:
HTML Code:
JavaScript Code :
Live Demo:
Contribute your code and comments through Disqus.
Previous: Find the specific option tag text value of a selected option.
Next: Write jQuery code to append a div element (and all of its contents) dynamically to the body element.
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics