JSFiddle - React, Tailwind, and code Playground

HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.6/moment.min.js"></script>
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <title></title>
    <meta name="description" content="" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <link rel="stylesheet" href="public/dist/css/style.min.css" />
  </head>
  <body>
    <div class="container">
      <div class="container-form">
      <form action="" id="form">
        <label for="inputName">Name</label>
        <input type="text" id="inputName" placeholder="Name" />
        <label for="inputDate">Birth Date</label>
        <input type="text" id="inputDate" placeholder="MM-DD-YYYY" />
      </form>
      <button class="btnDesign" id="enter" style="margin-top: 16px;">ENTER!</button>
      <p class="anim" id="error"></p>
    </div>
      <div class="greetings">
        <p id="welcome">test</p>
        <p id="birthdate">month, days</p>
      </div>
    </div>

    <script src="moment-with-locales.min.js"></script>
    <script src="script.js"></script>
  </body>
</html>

JavaScript

//for the buttons
let enterButton = document.getElementById('enter');
enterButton.addEventListener("click", letsGo);

function letsGo() {
//vars
let yr, month, y, b;

  //for the inputs
  let name = document.querySelector('#inputName').value;
  let date = document.querySelector('#inputDate').value;
  let welcm = document.getElementById("welcome").innerHTML;
  let errorpopup = document.getElementById("error");
  let animation = document.getElementsByClassName("anim")[0];

  let currDate = moment().format("MM-DD-YYYY");
  let getDate = moment(date, "MM-DD-YYYY");
  if (getDate.isValid()) {
    //for the name
    welcm = "Welcome " + name;
    //calculating years
    yr = currDate.diff(getDate, 'years');
    getDate.add(yr, 'years');
    //calculating motnhs
    month = currDate.diff(getDate, 'months');
    getDate.add(month, 'months');

    console.log("nays", yr, month, currDate);
  } else {
    errorpopup.innerHTML = "Check Date";
    animation.classList.add('animError');
  }
  //console.log(getDate, errorpopup);
}