JSFiddle - React, Tailwind, and code Playground

by tea4two

HTML

<input type="file" id="tester" name="tester" />

<a href="#" id="checker">check it</a>

JavaScript

$(function() {
    $('input[name="tester"]').change( function() {
        console.log( $(this).val() );
    });
    $('#checker').on('click', function() {
        if($('input[name="tester"]').val().length > 0) {
            console.log('はいってま');
        } else {
            console.log('はいってまへんで');
        }
        return false;
    });
});