In this paper, we investigate the nonlinear optical response characteristics of a metallic nanograting with nonlinear Kerr media within its slits using the finite element method. The proposed nanograting system is illuminated by a nanosecond Gaussian pulse laser under normal incidence and the electric filed pointing across the slits. The results show a perfect linear absorption at resonance wavelength thanks to the coupling of the surface plasmon resonance (SPR) mode and photon cavity mode. We simulate the transient nonlinear absorption variation of the system when the pulse laser is set up at either resonance or off-resonance wavelengths. The results indicate that the unit linear absorption drastically decreases by increasing the laser fluence around the center of the pulse. Interestingly, one can also enhance the weak linear off-resonance absorption to the value of unit by increasing the pulse laser fluence. The higher the laser fluence, the higher the maximum absorption contrast between linear and nonlinear regimes occurs owing to the nonlinear Kerr effect. Indeed, when the laser fluence reaches a critical value, it can excite the Kerr nonlinearity, which changes the coupling strength of SPR mode and the photon cavity mode leading to the absorption adjustment in the nanograting. These properties indicate the possibility of utilizing the proposed nanograting in dual functional absorber and nonabsorber systems, which make it an appropriate candidate for agile optical switching devices.