Yes you have to export as HTML. But I am not very familiar with Game Maker Studio. Therefore, you should check out their documentation. Also, carefully read the itch.io documents about uploading a Web build because this process is a little different. Make sure to test out the entire procedure before doing it in an actual Game Jam.
Take a look at these:
https://help.yoyogames.com/hc/en-us/articles/115000992307-Setting-Up-For-HTML5
https://itch.io/docs/creators/html5
Hope this helps :)