How do I check/uncheck a checkbox input or radio button?

How do I check/uncheck a checkbox input or radio button?
Just simple you use, check or uncheck a checkbox element or a radio button using the  .prop()   method:

// Check #x
$( "#x" ).prop( "checked", true );
// Uncheck #x
$( "#x" ).prop( "checked", false );

source form : https://learn.jquery.com/using-jquery-core/faq/how-do-i-check-uncheck-a-checkbox-input-or-radio-button/