make use the function that use generics for foletrign invlaid htmlelements