function handle_input(e) {
    var styleEl = document.getElementById('custom-style');
    var inputEl = document.getElementById('config-area');
    var saveEl = document.getElementById('save');
    
    styleEl.innerHTML = inputEl.value;
    saveEl.disabled = false;
    
    repopulate_subtitles();
}

function repopulate_subtitles() {
    $(".most-subtitles").remove();
    
    var samples = {
        en: "<i>He doesn't have any friends in Korea so he probably doesn't even have anyone to eat with.</i>",
        de: "<i> Er hat keine Freunde in Korea, also wird er wahrscheinlich niemanden haben, mit dem er was essen kann.</i>"
    };
    
    var styleEl = document.getElementById('custom-style');
    var languages = get_used_languages();
    for (var i = 0; i < languages.length; i++) {
        var div = document.createElement("div");
        div.className = "most-subtitles most-" + languages[i];
        div.innerHTML = samples[languages[i]] ||
            "[No sample available for language " + languages[i] + ".]" +
            "<br>[Some more text.]";
        document.getElementById("common-container").appendChild(div);
    }
}

function get_used_languages() {
    result = [];
    var styleEl = document.getElementById('custom-style');
    for (var i = 0; i < styleEl.sheet.rules.length; i++) {
        var re = /\.most-([A-z][A-z])\W/g;
        var m;
        while (m = re.exec(styleEl.sheet.rules[i].selectorText + " ")) {
            if (result.indexOf(m[1]) == -1) {
                result.push(m[1]);
            }
        }
    }
    return result;
}

function restore_options() {
    var styleEl = document.getElementById('custom-style');
    var inputEl = document.getElementById('config-area');
    
    chrome.storage.sync.get(null, function(items) {
        if (items.customStyle !== undefined) {
            styleEl.innerHTML = items.customStyle;
        }
        inputEl.innerHTML = styleEl.innerHTML;
    });
    
    repopulate_subtitles();
}

function save_options() {
    var styleEl = document.getElementById('custom-style')
  
    chrome.storage.sync.set({customStyle: styleEl.innerHTML}, function() {
        var saveEl = document.getElementById('save');
        saveEl.disabled = true;
    });
}

function remove_storage() {
    chrome.storage.sync.remove('customStyle');
}

$("#config-area").on('input', handle_input);
document.addEventListener('DOMContentLoaded', restore_options);
document.getElementById('save').addEventListener('click', save_options);
document.getElementById('remove').addEventListener('click', remove_storage);

@@ -28,225 +28,87 @@
     
-var styleEl = document.getElementById('custom-style');%0A    var inputEl = document.getElementById('config-area');%0A    var saveEl = document.getElementById('save');%0A    %0A    styleEl.innerHTML = inputEl.value;%0A    saveEl
+$(%22#custom-style%22)%5B0%5D.innerHTML = $(%22#config-area%22)%5B0%5D.value;%0A    $(%22#save%22)%5B0%5D
 .dis
@@ -505,67 +505,8 @@
    %0A
-    var styleEl = document.getElementById('custom-style');%0A
     
@@ -875,33 +875,12 @@
     
-document.getElementById
+$
 (%22
+#
 comm
@@ -893,16 +893,19 @@
 tainer%22)
+%5B0%5D
 .appendC
@@ -985,57 +985,49 @@
 var 
-styleEl = document.getElementById('custom-style')
+rules = $(%22#custom-style%22)%5B0%5D.sheet.rules
 ;%0A  
@@ -1048,30 +1048,16 @@
  0; i %3C 
-styleEl.sheet.
 rules.le
@@ -1158,22 +1158,8 @@
 xec(
-styleEl.sheet.
 rule
@@ -1352,130 +1352,8 @@
 ) %7B%0A
-    var styleEl = document.getElementById('custom-style');%0A    var inputEl = document.getElementById('config-area');%0A    %0A
     
@@ -1434,9 +1434,9 @@
 yle 
-!
+=
 == u
@@ -1463,92 +1463,204 @@
     
-styleEl.innerHTML = items.customStyle;%0A        %7D%0A        inputEl.innerHTML = styleEl
+$(%22#remove%22)%5B0%5D.disabled = true;%0A        %7D else %7B%0A            $(%22#custom-style%22)%5B0%5D.innerHTML = items.customStyle;%0A        %7D%0A        %0A        $(%22#config-area%22)%5B0%5D.innerHTML = $(%22#custom-style%22)%5B0%5D
 .inn
@@ -1675,17 +1675,17 @@
     
-%7D);
+    
 %0A    
-%0A
     
@@ -1700,32 +1700,40 @@
 te_subtitles();%0A
+    %7D);%0A
 %7D%0A%0Afunction save
@@ -1757,58 +1757,57 @@
 var 
-s
+customS
 tyle
-El
  = 
-document.getElementById('custom-style')%0A
+$(%22#custom-style%22)%5B0%5D.innerHTML;%0A  
   %0A 
@@ -1851,25 +1851,19 @@
 le: 
-styleEl.innerHTML
+customStyle
 %7D, f
@@ -1886,68 +1886,62 @@
     
-var saveEl = document.getElementById('save');%0A        saveEl
+$(%22#save%22)%5B0%5D.disabled = true;%0A        $(%22#remove%22)%5B0%5D
 .dis
@@ -1944,27 +1944,28 @@
 .disabled = 
-tru
+fals
 e;%0A    %7D);%0A%7D
@@ -2041,16 +2041,53 @@
 tyle');%0A
+    $(%22#remove%22)%5B0%5D.disabled = true;%0A
 %7D%0A%0A$(%22#c
@@ -2194,39 +2194,21 @@
 s);%0A
-document.getElementById('save')
+$(%22#save%22)%5B0%5D
 .add
@@ -2249,41 +2249,23 @@
 s);%0A
-document.getElementById('
+$(%22#
 remove
-')
+%22)%5B0%5D
 .add

Use more $ syntax