jquery – Disable WordPress Comment Submit button IF Textarea and Name is Empty

I need help getting the following code to deactivate the WordPress comment submit button IF the textarea (comment area) and / or name field are empty.

add_action('wp_footer','disable_submit_on_empty_comment_area_name');
function disable_submit_on_empty_comment_area_name() { ?>
<script>
$(document).ready(function() {
    $('input(type="submit")').attr('disabled', true);
    
    $('input(type="text"),textarea').on('keyup',function() {
        var textarea_value = $("#comment").val();
        var text_value = $('input(name="name")').val();
        
        if(textarea_value != '' && text_value != '') {
            $('input(type="submit")').attr('disabled', false);
        } else {
            $('input(type="submit")').attr('disabled', true);
        }
    });
});
</script>
<?php
}