Javascript not working on mobile but works on desktop
<p>This works on a desktop browser, but not on my iOS mobile phone. I tried adding 'touchstart' and looked at <a href="https://stackoverflow.com/questions/25873639/jquery-onclick-not-working-on-mobile">this post's solution</a> to check how other's got it to work, but it still isn't working. Any suggestions as to other options? I also tried adding <code>e.preventDefault()</code> - and added e to function(), but that didn't work as well.</p>

<p>I have tried:</p>

<pre><code> $('body').on('click touchstart', '.myContainer', function() {
     $(this).toggleClass('myContainer-unselected').toggleClass('myContainer-selected');
 });
</code></pre>

<p>Edit:
It appears there may be something else going on, I changed the code to be as general as possible and it is not firing the event on iOS, but working in my chrome emulator:</p>

<pre><code>$(document).on('click touchstart', 'body', function() {
      alert('hi');
    });
</code></pre>

<p>Additional update:</p>

<p>I have added the following code to my script.js file:</p>

<pre><code>$('body').css('display', 'none');
</code></pre>

<p>As expected, the screen goes blank on my desktop browser for both local and on heroku, but when I test on mobile, the screen is not blank. It looks like js isn't working properly. </p>

<p>Images attached:</p>

<p><a href="https://i.stack.imgur.com/bs9yn.png" rel="noreferrer"><img src="https://i.stack.imgur.com/bs9yn.png" alt="enter image description here"></a><a href="https://i.stack.imgur.com/LhFpM.png" rel="noreferrer"><img src="https://i.stack.imgur.com/LhFpM.png" alt="enter image description here"></a></p>