JSFiddle - React, Tailwind, and code Playground

HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<div id="regalo">Regalo</div>
<br>
<div class="tooltip">Tooltip</div>
<br>
<div id="alert">Alert</div>
<br>
<input type="text" id="total" value="">
<button type="button" class="bbp">Enter</button>
<br>
<br>
To see "Regalo" type a value between 100 and 299 and click enter.
<br>
<br>
"Alert" should only be displayed if the input = 0 + keep hidden with any other value + orientation device landscape.
<br><br>
This last point (<strong>orientation device landscape</strong>) is my problem!
<br><br>
Note: "Tooltip" is hidden after 2 secs.

CSS

#alert,
.tooltip {
  display: none
}

@media screen and (max-width:999px) and (orientation:landscape) {

  #alert {
    display: block;
  }

JavaScript

$(document).ready(function() {
  function manageRegalo() {

    var totalStorage = Number(localStorage.getItem("total"));
    var total = parseFloat($("#total").val());

    if (totalStorage != null && total === 0) {
      total = totalStorage;
    }

    if (total > 99.99 && total < 299.99) {
      console.log("PASS");
      $('#regalo').show();
      $('#alert').hide();

      if (localStorage.getItem('suppress_gift_tooltip_1') == null) {
        $('.tooltip').show();
        window.setTimeout(function() {
          $('.tooltip').fadeOut('slow');
        }, 2000);

        //--------------------

        if (!$("#notify")[0].paused) { //play audio
          $("#notify")[0].pause(); //play audio
          $("#notify")[0].currentTime = 0; //play audio

        } else { // play audio
          setTimeout(function() { //play audio
            $("#notify")[0].play(); //play audio
          })
        }; //play audio

        //--------------------

        localStorage.setItem('suppress_gift_tooltip_1', 'true')
      }

    } else if (!total) {
      $('#regalo').hide();
      $('#alert').show();
    } else {
      console.log("FAIL");
      $('#alert').hide();
      $('#regalo').hide();
    }
  }

  $(document).on('click', function(event) {
    const target = event.target;
    if (target.matches('.comp-clone') || target.matches('.bbp')) {
      manageRegalo();

      localStorage.setItem('total', Number($("#total").val()));
    }
  });
  manageRegalo();
});