Source Code:
(back to article)
Submit
Result:
Report an issue
<!DOCTYPE html> <html> <head> <title>Title of the Document</title> <script src="https://code.jquery.com/jquery-3.5.0.min.js"></script> </head> <body> <div id="checkList"> <input id="checkbox1" type="checkbox" name="one" value="1" /> </div> <input type="button" id="btnCheck" value="Check" /> <input type="button" id="btnUnCheck" value="UnCheck" /> <script> $('#btnCheck').on('click', function() { $('#checkbox1').get(0).checked = true; }); $('#btnUnCheck').on('click', function() { $('#checkbox1').get(0).checked = false; }); </script> </body> </html>