JSFiddle - React, Tailwind, and code Playground

HTML

<input id='showDeletedQuestionsId' name='showDeletedQuestions' type='checkbox' style='margin-right: 3px' />

JavaScript

$('#showDeletedQuestionsId').change(function(){
var showDeletedCheckbox = $('#showDeletedQuestionsId').is(':checked');

if(showDeletedCheckbox){
    alert('checked')
    
}else{
    alert('not checked')
}

})