What I’m trying to do is the
inner code (result) will only work when there’s an attribute of
But since my target doesn’t have an attribute of
Validity, I want to prevent the inner code to run by having an
What can I do to check/prevent the error of
TypeError: e.target.getAttribute is not a function?
use optional chaining or