text: var enbutton = document.getElementById("encode-button");
  var debutton = document.getElementById("decode-button");
  var encrypted = document.getElementById("encrypted-message");
  var decrypted = document.getElementById("decrypted-message");
  var shift = document.getElementById("input-shift");
  
  if(enbutton){
    enbutton.addEventListener("click", function(){
      if(encrypted.value == "" || shift.value == ""){
        alert("Please enter both the message and shift value!");
      }
      else if (!/^[a-zA-Z\s]+$/.test(encrypted.value)){
        alert("Input must be letters only!");
      }
      else if(shift.value < 0 || shift.value > 26){
        alert("Shift must be from 1 to 26!");
      }
      else{
        var decryptedStr = "";
        for(var i = 0; i<encrypted.value.length; i++){
          var character = encrypted.value;
          
          if(character[i] == " "){ //space, whitespace
            decryptedStr += " ";
            continue;
          }
          
          if(character == character.toLowerCase()){
            var c = (character.charCodeAt(i) - 97) % 26;
            var ch = ((parseInt(c) + parseInt(shift.value)) % 26) + 97;
            var chStr = String.fromCharCode(ch);
            decryptedStr += chStr;
          }
          else{ //uppercase
            var c = (character.charCodeAt(i) - 65) % 26;
            var ch = ((parseInt(c) + parseInt(shift.value)) % 26) + 65;
            var chStr = String.fromCharCode(ch);
            decryptedStr += chStr;
          }
        }//end of forloop
        decrypted.innerText = decryptedStr;
      } 
  });
  }