JSFiddle - React, Tailwind, and code Playground

by kentaromiura

HTML

Albhed :
<input type=text id=input>
<button id=fire>translate</button>
<hr>
<div id=target></div>

JavaScript

var input = document.getElementById('input')
var translation = {
    A: "E",
    B: "P",
    C: "S",
    D: "T",
    E: "I",
    F: "W",
    G: "K",
    H: "N",
    I: "U",
    J: "V",
    K: "G",
    L: "C",
    M: "L",
    N: "R",
    O: "Y",
    P: "B",
    Q: "X",
    R: "H",
    S: "M",
    T: "D",
    U: "O",
    V: "F",
    W: "Z",
    X: "Q",
    Y: "A",
    Z: "J",
        ' ': ' '
}
document.getElementById('fire').onclick = function () {
    target.innerHTML = input.value.toUpperCase().split('').map(function (a) {
        return translation[a]
    }).join('')


}