Converting string to type address - in JavaScript or Solidity?

Hi everyone, I am working on converting a html string input to a type address. The idea is to have an input field on the website, so that contract owner can input an address that then shall be approved in the contract. So I have to convert the input string and pass it as type address to the approve function. I already did try to do the conversion in JavaScript, but how can I make it a type bytes20?

MyTryToConvert
/*TRY TO CONVERT INPUT TO bytes20
var bytes = [];
var charCode = str.charCodeAt
for (var i = 0; i < 20; i++){
  charCode = str.charCodeAt(i);
  bytes[i] = byte(uint8(uint(str) / (2**(8*(19-i)))));
}

for (var i = 0; i < str.length; ++i)
{
    charCode = str.charCodeAt(i);
    bytes.push((charCode & 0xFF00) >> 8);
    bytes.push(charCode & 0xFF);
}
*/