var input = document.querySelector("input")/* Use document.querySelector("element's css selector") to target the input */;

var pushCharacter = function(character) {
    /* This will push the character to the input.value */
    input.value = input.value + character/* Guess what */;
};

var buttons = document.querySelectorAll(".button");

for (var i = 0; i < buttons.length; i++) {
    buttons[i].onclick = function() { pushCharacter(buttons[i].innerHTML); }
};

var calculate = function() {
    /* Set input.value to eval(input.value).toString() */
    input.value = eval(input.value).toString();
};

var equalbutton = document.querySelector(".button-equals");/* Same for input, but instead with .button-equals */

equalbutton.onclick = calculate;

var clear = function() {
    /* Set the input.value to an empty string */
    input.value = "";
};

var clearbutton = document.querySelector(".clearbutton");
clearbutton.onclick = clear;

@@ -1,128 +1,90 @@
-var input = document.querySelector(%22input%22)/* Use document.querySelector(%22element's css selector%22) to target the input */;%0A%0A
+window.onload = function() %7B%0A    var input = document.querySelector(%22#display%22);%0A%0A    
 var 
@@ -117,24 +117,28 @@
 haracter) %7B%0A
+    
     /* This 
@@ -179,32 +179,36 @@
 ut.value */%0A    
+   
+ 
 input.value = in
@@ -232,30 +232,21 @@
 cter
-/* Guess what */;%0A%7D;%0A%0A
+;%0A    %7D;%0A    
 var 
@@ -293,17 +293,20 @@
 tton%22);%0A
-%0A
+    
 for (var
@@ -344,16 +344,20 @@
 ) %7B%0A    
+  
+  
 buttons%5B
@@ -421,20 +421,28 @@
 TML); %7D%0A
-%7D;%0A%0A
+    %7D;%0A%0A    
 var calc
@@ -470,62 +470,8 @@
     
-/* Set input.value to eval(input.value).toString() */%0A
     
@@ -514,20 +514,27 @@
 ring();%0A
-%7D;%0A%0A
+    %7D;%0A    
 var equa
@@ -588,63 +588,13 @@
 s%22);
-/* Same for input, but instead with .button-equals */%0A%0A
+%0A    
 equa
@@ -623,16 +623,20 @@
 ulate;%0A%0A
+    
 var clea
@@ -660,53 +660,8 @@
     
-/* Set the input.value to an empty string */%0A
     
@@ -678,20 +678,27 @@
 e = %22%22;%0A
-%7D;%0A%0A
+    %7D;%0A    
 var clea
@@ -747,16 +747,20 @@
 tton%22);%0A
+    
 clearbut
@@ -780,8 +780,11 @@
  clear;%0A
+%7D;%0A

Fix JS