I am new to this. all online examples are not helping me debug. what am I missing? the idea is the user inputs something they want to turn into a cryptogram and the js function encrypts it for them. the js runs fine on its own. the disconnect happens when trying to make the function Crypt() work with the html.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<input type="text" id="input1" />
<button onclick="Crypt()">Submit</button>
<script src="app.js"></script>
</head>
<body>
</body>
</html>
function Crypt(){
var input = document.getElementById('input1').value;
var resultArray = [];
for(var i = 0; i < input.length; i++){
if(input[i] === 'a'){
resultArray.push('p');
} else if("input"[i] === 'b'){
resultArray.push('l');
}else if(input[i] === 'c'){
resultArray.push('m');
}else if(input[i] === 'd'){
resultArray.push('n');
}else if(input[i] === 'e'){
resultArray.push('k');
}else if(input[i] === 'f'){
resultArray.push('o');
}else if(input[i] === 'g'){
resultArray.push('i');
}else if(input[i] === 'h'){
resultArray.push('j');
}else if(input[i] === 'i'){
resultArray.push('t');
} //you get the idea
else{
resultArray.push(' ');
}
} document.write(resultArray.join(''));
}