How Do You Put a Function On a Value in HTML?
<p>I am a horrible coder and I feel bad for myself (I know how you feel about me.) Anyhow, I have no idea how to change the value according to a value in JavaScript of another page without affecting the JavaScript page value. Just look at the code..</p>

<pre><code>&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta charset=utf-8 /&gt;
&lt;title&gt;JS Bin&lt;/title&gt;
&lt;/head&gt;
  &lt;script&gt;
    window.xox = function () {
      if (document.getElementById("text").value !== "45 Characters Max. (NO NUMBERS!)") {
      document.getElementById("text").value = console.getElement("x").value;
        //If my mistake is the inability of the problem of which value changes, I already tried to fix that. I do not understand how to do it I guess...
      }
    };
  &lt;/script&gt;
&lt;body&gt;
  &lt;input type = 'button' value = 'Code/Decode Following Language' onclick='xox()'/&gt;
  &lt;input type = 'text' name = "text" id = "text" value = '45 Characters Max. (NO NUMBERS!)'/&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>And the JavaScript:</p>

<pre><code>window.xox = function () {
    var x = dxc();
    function dxc() {
var dothis = document.getElementById("text").value;
        return("&lt;==" + stg(dothis.charAt(0)) + stg(dothis.charAt(1)) + stg(dothis.charAt(2)) + stg(dothis.charAt(3)) + stg(dothis.charAt(4)) + stg(dothis.charAt(5)) + stg(dothis.charAt(6)) + stg(dothis.charAt(7)) + stg(dothis.charAt(8)) + stg(dothis.charAt(9)) + stg(dothis.charAt(10)) + stg(dothis.charAt(11)) + stg(dothis.charAt(12)) + stg(dothis.charAt(13)) + stg(dothis.charAt(14)) + stg(dothis.charAt(15)) + stg(dothis.charAt(16)) + stg(dothis.charAt(17)) + stg(dothis.charAt(18)) + stg(dothis.charAt(19)) + stg(dothis.charAt(20)) + stg(dothis.charAt(21)) + stg(dothis.charAt(22)) + stg(dothis.charAt(23)) + stg(dothis.charAt(24)) + stg(dothis.charAt(25)) + stg(dothis.charAt(26)) + stg(dothis.charAt(27)) + stg(dothis.charAt(28)) + stg(dothis.charAt(29)) + stg(dothis.charAt(30)) + 
stg(dothis.charAt(31)) + stg(dothis.charAt(32)) + 
stg(dothis.charAt(33)) + stg(dothis.charAt(34)) + stg(dothis.charAt(35)) + stg(dothis.charAt(36)) + stg(dothis.charAt(37)) + stg(dothis.charAt(38)) + stg(dothis.charAt(39)) + stg(dothis.charAt(40)) + stg(dothis.charAt(41)) + stg(dothis.charAt(42)) + stg(dothis.charAt(43)) + stg(dothis.charAt(44)) + stg(dothis.charAt(45)) + "==&gt;");
    }

    function stg(d) {
      if (d === "d") {
        return "p";
      }
      if (d === "p") {
        return "d";
      }
      if (d === "x") {
        return "f";
      }
      if (d === "f") {
        return "x";
      }
      if (d === "c") {
        return "w";
      }
      if (d === "w") {
        return "c";
      }
      if (d === "b") {
        return "s";
      }
      if (d === "s") {
        return "b";
      }
      if (d === "a") {
        return "n";
      }
      if (d === "n") {
        return "a";
      }
      if (d === "w") {
        return "q";
      }
      if (d === "q") {
        return "w";
      }
      if (d === "u") {
        return "d";
      }
      if (d === "d") {
        return "u";
      }
      if (d === "t") {
        return "r";
      }
      if (d === "t") {
        return "r";
      }
      if (d === " ") {
        return "#";
      }
      if (d === "#") {
        return " ";
      }
      if (d === "e") {
        return "x";
      }
      if (d === "x") {
        return "e";
      }
      if (d === "c") {
        return "p";
      }
      if (d === "p") {
        return "c";
      }
      if (d === "q") {
        return "i";
      }
      if (d === "i") {
        return "q";
      }
      if (d === "f") {
          return "a";
      }
      if (d === "a") {
        return "f";
      }
      if (d === "z") {
        return "r";
      }
      if (d === "r") {
        return "z";
      }
      if (d === "j") {
        return "b";
      }
      if (d === "b") {
        return "j";
      }
      if (d === "g") {
        return "e";
      }
      if (d === "e") {
        return "g";
      }
      if (d === "h") {
        return "l";
      }
      if (d === "l") {
        return "h";
      }
      if (d === "i") {
        return "g";
      }
      if (d === "g") {
        return "i";
      }
      if (d === "k") {
        return "z";
      }
      if (d === "z") {
        return "k";
      }
      if (d === "n") {
        return "h";
      }
      if (d === "h") {
        return "n";
      }
      if (d === "s") {
        return "u";
      }
      if (d === "u") {
        return "s";
      }
      if (d === "") {
        return "";
      }
      if (d === "y") {
        return "k";
      }
      if (d === "k") {
        return "y";
      }
      if (d === "o") {
        return "v";
      }
      if (d === "v") {
        return "o";
      }
      if (d === "m") {
        return "y";
      }
      if (d === "y") {
        return "m";
      }
      if (d === "l") {
        return "o";
      }
      if (d === "o") {
        return "l";
      }
      if (d === "v") {
       return "m";
      }
      if (d === "m") {
        return "v";
      }
      if (d === "t") {
        return "j";
      }
      if (d === "j") {
        return "t";
      }
      if (d === "!") {
        return "|";
      }
      if (d === "|") {
        return "!";
      }
      if (d === ",") {
        return "$";
      }
      if (d === "$") {
        return ",";
      }
      if (d === ".") {
        return "*";
      }
      if (d === "*") {
        return ".";
      }
      if (d === "1") {
       return "~@";
      }
      if (d === "2") {
        return "~@!";
      }
      if (d === "3") {
        return "~*";
      }
      if (d === "4") {
        return "~*@";
      }
      if (d === "5") {
        return "~*@!";
      }
      if (d === "6") {
        return "~**";
      }
      if (d === "7") {
        return "~**@";
      }
      if (d === "8") {
        return "~**@!";
      }
      if (d === "9") {
        return "~***";
      }
      if (d === "?") {
        return ":";
      }
    }
};


//welcomedin: d, x, c, b, a, w, u, r,  , e, p, q, f, j, g, h, i, k, n, z, s, y, o, m, l, v, t
// returned : p, f, w, s, n, q, d, t, #, x, c, i, a, r, b, e, l, g, z, h, u, k, v, y, o, m, j
</code></pre>
