Custom Code (JS) not working on IOS

I added custom code (JavaScript) to my website which edits an event section and adds an extra button to it. Now this all works fine in browser view but as soon as I switch to my phone the button dissapears. I tried both Chrome and Safari on my phone but both of them looked the same, however in Chrome if I switch to desktop view on my phone, everything looks fine. Any ideas why it could be?

On browser view:


On phone: