Looking to show/hide a div if the browser is mobile. My current code is as follow:
<script>
    if(! navigator.userAgent.match(/Android/i) && ! navigator.userAgent.match(/webOS/i) && ! navigator.userAgent.match(/iPhone/i) && ! navigator.userAgent.match(/iPod/i) &&
     ! navigator.userAgent.match(/iPad/i) &&! navigator.userAgent.match(/Blackberry/i) )
    {
     $('#mobile').hide();
    } else {
        $('#mobile').show();
        alert('tablet detected');
        //turns on mobile DIV
    }
</script>
I receive the alert when viewing mobile but do not see my #mobile div. Any suggestions greatly appreciated.
 
    