JSFiddle - React, Tailwind, and code Playground

by FungLee

HTML

<input type='file' id='godzilla'/>
<button onclick='document.getElementById("godzilla").click()'>mech-godzilla</button>

JavaScript

var godzilla = document.getElementById('godzilla')

godzilla.onclick = charge

function charge()
{
    document.body.onfocus = roar
    console.log('chargin')
}
    
function roar()
{
    if(godzilla.value.length) alert('ROAR! FILES!')
    else alert('*empty wheeze*')
    document.body.onfocus = null
    console.log('depleted')
}