In the official documentation you can read:
As of Unreal Engine 4.24, support for the HTML5 platform has been migrated out of the engine to a public Platform Extension that can be maintained and improved by community members. Documentation for the HTML5 Platform Extension is hosted alongside the GitHub repository.
You could try if it works with UE5 but you will be limited because many engine features are not supported