how to add attribute checked in js code example Example: set attribute checked jquery $( this ).attr( 'checked', true )