High-performance ultraviolet (UV) photodetectors require not only high responsivity and detectivity, but also strong spectral selectivity to suppress visible light interference. While wide-bandgap semiconductors are typically used, challenges in material growth and chemical doping hinder their scalability and integration. Here, we demonstrate a UV photodetector based on a two-dimensional floating-gate field-effect transistor (FGFET) structure, which offers both high sensitivity and tunable spectral response. A representative Au/hBN/MoS2 FGFET fabricated on a Si/SiO2 substrate achieves an ultrahigh responsivity of 5.6 × 104 A W-1 under 254 nm illumination, with a cut-off wavelength of 360 nm. The photodetection mechanism relies on UV-induced excitation of stored electrons in the floating gate. These electrons overcome the interfacial barrier and tunnel through the dielectric layer, thereby modulating the floating gate potential and channel conductance. The spectral response is primarily determined by the interfacial barrier height. Therefore, we demonstrate that by selecting floating gate metals with different work functions (e.g., Cr, Al, and Pd), the cut-off wavelength can be tuned from 440 nm to 330 nm. With excellent sensitivity and tunable spectral selectivity, this platform shows strong potential for applications in UV imaging, arc discharge monitoring, and adaptive optoelectronic systems.