diff --git a/dev/js/spec/hintSpec.js b/dev/js/spec/hintSpec.js
index 45850a4..a78a835 100644
--- a/dev/js/spec/hintSpec.js
+++ b/dev/js/spec/hintSpec.js
@@ -84,7 +84,7 @@
     it('should be initializable', function () {
       // Supports: context, searchField
       var inputField = inputClass.create(input);
-      expect(inputField._element).not.toBe(undefined);
+      expect(inputField._el).not.toBe(undefined);
     });
 
     it('should have text', function () {
diff --git a/dev/js/spec/menuSpec.js b/dev/js/spec/menuSpec.js
index a2ca40b..12a8fc1 100644
--- a/dev/js/spec/menuSpec.js
+++ b/dev/js/spec/menuSpec.js
@@ -74,8 +74,8 @@
       },
       element : function () {
         // already defined
-        if (this._element !== undefined)
-	        return this._element;
+        if (this._el !== undefined)
+	        return this._el;
 
         // Create list item
         var li = document.createElement("li");
@@ -93,7 +93,7 @@
 	        desc.appendChild(document.createTextNode(this._desc));
 	        li.appendChild(desc);
         };
-        return this._element = li;
+        return this._el = li;
       }
     };
 
diff --git a/dev/js/spec/queryCreatorSpec.js b/dev/js/spec/queryCreatorSpec.js
index 09189bc..780a7bf 100644
--- a/dev/js/spec/queryCreatorSpec.js
+++ b/dev/js/spec/queryCreatorSpec.js
@@ -702,7 +702,7 @@
 
       qc._q = document.createElement('input');
       
-      qc._element.click();
+      qc._el.click();
 
       expect(qc._ql.selectedIndex).toEqual(1);
       expect(qc._q.value).toEqual("[orth=Baum]");
diff --git a/dev/js/spec/vcSpec.js b/dev/js/spec/vcSpec.js
index f30498e..7beede7 100644
--- a/dev/js/spec/vcSpec.js
+++ b/dev/js/spec/vcSpec.js
@@ -1336,14 +1336,14 @@
 
       // Remove operand 1
       expect(docGroup.delOperand(doc).update()).not.toBeUndefined();
-      expect(doc._element).toEqual(undefined);
+      expect(doc._el).toEqual(undefined);
 
       doc = docGroup.getOperand(1);
       expect(doc.key()).toEqual("foo");
 
       // Remove operand 1
       expect(docGroup.delOperand(doc).update()).not.toBeUndefined();
-      expect(doc._element).toEqual(undefined);
+      expect(doc._el).toEqual(undefined);
 
       // Only one operand left ...
       expect(docGroup.getOperand(1)).toBeUndefined();
diff --git a/dev/js/src/buttongroup.js b/dev/js/src/buttongroup.js
index 0ea1d38..85543e4 100644
--- a/dev/js/src/buttongroup.js
+++ b/dev/js/src/buttongroup.js
@@ -18,7 +18,7 @@
         cl.add.apply(cl,classes);
       };
       cl.add('button-group');
-      this._element = e;
+      this._el = e;
       return this;
     },
 
@@ -27,7 +27,7 @@
      * Return main element
      */
     element : function () {
-      return this._element;
+      return this._el;
     },
 
     
@@ -52,7 +52,7 @@
      */
     add : function (title, data, cb) {
       
-      const b = this._element.addE('span');
+      const b = this._el.addE('span');
       b.setAttribute('title',title);
 
       if (data !== undefined) {
@@ -107,7 +107,7 @@
      * The state has to be a state object.
      */
     addToggle : function (title, data, state) {
-      const b = this._element.addE('span');
+      const b = this._el.addE('span');
       b.setAttribute('title',title);
 
       if (data != undefined) {
@@ -168,7 +168,7 @@
      * Remove all defined buttons
      */
     clear : function () {
-      _removeChildren(this._element);
+      _removeChildren(this._el);
       return this;
     }
   }
diff --git a/dev/js/src/buttongroup/menu.js b/dev/js/src/buttongroup/menu.js
index da34584..7a4f8df 100644
--- a/dev/js/src/buttongroup/menu.js
+++ b/dev/js/src/buttongroup/menu.js
@@ -2,6 +2,7 @@
  * Menu to choose from in a button group.
  */
 "use strict";
+
 define(['menu'], function (menuClass) {
 
   return {
@@ -84,11 +85,11 @@
 
     _repos : function (e) {
       const bounding = e.getBoundingClientRect();
-      this._element.style.left = bounding.left + "px";
-      this._element.style.top = (
+      this._el.style.left = bounding.left + "px";
+      this._el.style.top = (
         bounding.top +
           bounding.height -
-          this._element.clientHeight
+          this._el.clientHeight
       ) + "px";
     }
   };
diff --git a/dev/js/src/datepicker.js b/dev/js/src/datepicker.js
index 61f6a8b..c2b0570 100644
--- a/dev/js/src/datepicker.js
+++ b/dev/js/src/datepicker.js
@@ -116,7 +116,7 @@
      */
     show : function (year, month) {
 
-      const e = this._element = d.createElement('div');
+      const e = this._el = d.createElement('div');
       e.setAttribute('tabindex', 0);
       e.style.outline = 0;
       e.classList.add('datepicker');
@@ -170,7 +170,7 @@
 
       t._input.focus();
 
-      return t._element;
+      return t._el;
     },
 
     _stringHelper : function () {
@@ -213,7 +213,7 @@
      * Get the HTML element associated with the datepicker.
      */
     element : function () {
-      return this._element;
+      return this._el;
     },
 
 
diff --git a/dev/js/src/hint/alert.js b/dev/js/src/hint/alert.js
index c8d7696..7847af2 100644
--- a/dev/js/src/hint/alert.js
+++ b/dev/js/src/hint/alert.js
@@ -19,9 +19,9 @@
       const t = this;
       t._type = 'alert';
       t.active = false;
-      t._element = document.createElement('div');
-      t._element.style.display = 'none';
-      t._element.classList.add('alert', 'hint');
+      t._el = document.createElement('div');
+      t._el.style.display = 'none';
+      t._el.classList.add('alert', 'hint');
       return t;
     },
 
@@ -31,7 +31,7 @@
      */
     show : function (msg) {
       this.active = true;
-      const e = this._element;
+      const e = this._el;
       e.textContent = msg;
       e.style.display = 'block';
     },
@@ -43,7 +43,7 @@
     hide : function () {
       if (!this.active)
 	      return false;
-      this._element.style.display = 'none';
+      this._el.style.display = 'none';
       this.active = false;
       return true;
     },
@@ -53,7 +53,7 @@
      * Get alert object.
      */
     element : function () {
-      return this._element;
+      return this._el;
     }
   }
 });
diff --git a/dev/js/src/hint/input.js b/dev/js/src/hint/input.js
index d779776..cabaa84 100644
--- a/dev/js/src/hint/input.js
+++ b/dev/js/src/hint/input.js
@@ -19,7 +19,7 @@
 
     // Initialize new input field
     _init : function (element) {
-      this._element = element;
+      this._el = element;
 
       this._container = document.createElement("div");
       this._container.setAttribute('id', 'hint');
@@ -38,7 +38,7 @@
       // Update position of the mirror
       const re = this.reposition.bind(this);
       window.addEventListener('resize', re);
-      this._element.addEventListener('onfocus', re);
+      this._el.addEventListener('onfocus', re);
       this.reposition();
       return this;
     },
@@ -68,7 +68,7 @@
      * hint helper is attached to.
      */
     element : function () {
-      return this._element;
+      return this._el;
     },
 
 
@@ -77,7 +77,7 @@
      * the hint helper is attached to.
      */
     value : function () {
-      return this._element.value;
+      return this._el.value;
     },
 
 
@@ -93,7 +93,7 @@
      * Reset the input value
      */
     reset : function () {
-      this._element.value = "";
+      this._el.value = "";
     },
 
 
@@ -114,7 +114,7 @@
      */
     insert : function (text) {
       const splittedText = this._split();
-      const s = this._element;
+      const s = this._el;
       s.value = splittedText[0] + text + splittedText[1];
       s.selectionStart = (splittedText[0] + text).length;
       s.selectionEnd = s.selectionStart;
@@ -129,7 +129,7 @@
      * Move hinthelper to given character position
      */
     moveto : function (charpos) {
-      const e = this._element;
+      const e = this._el;
       e.selectionStart = charpos;
       e.selectionEnd = charpos;
       e.focus();
@@ -142,8 +142,8 @@
      * below the input box.
      */
     reposition : function () {
-      const inputClientRect = this._element.getBoundingClientRect();
-      const inputStyle = window.getComputedStyle(this._element, null);
+      const inputClientRect = this._el.getBoundingClientRect();
+      const inputStyle = window.getComputedStyle(this._el, null);
 
       const bodyClientRect = 
             document.getElementsByTagName('body')[0].getBoundingClientRect();
@@ -187,7 +187,7 @@
      * or at the current cursor position.
      */
     _split : function (start) {
-      const s = this._element;
+      const s = this._el;
       const value = s.value;
 
       // Get start from cursor position
diff --git a/dev/js/src/hint/item.js b/dev/js/src/hint/item.js
index 2fcecee..5c9a9a7 100644
--- a/dev/js/src/hint/item.js
+++ b/dev/js/src/hint/item.js
@@ -94,8 +94,8 @@
      */
     element : function () {
       // already defined
-      if (this._element !== undefined)
-	      return this._element;
+      if (this._el !== undefined)
+	      return this._el;
 
       // Create list item
       var li = document.createElement("li");
@@ -117,7 +117,7 @@
 	      desc.addT(this._desc);
 	      li.appendChild(desc);
       };
-      return this._element = li;
+      return this._el = li;
     }
   };
 });
diff --git a/dev/js/src/hint/lengthField.js b/dev/js/src/hint/lengthField.js
index 79c7b7d..7cf8c19 100644
--- a/dev/js/src/hint/lengthField.js
+++ b/dev/js/src/hint/lengthField.js
@@ -15,12 +15,12 @@
      * Override the prefix action.
      */
     add : function (param) {
-      this._element.addE('span').addT(param[0] + '--');
+      this._el.addE('span').addT(param[0] + '--');
 
-      var desc = this._element.addE('span');
+      var desc = this._el.addE('span');
       desc.classList.add("desc");
       desc.addT(param[2] + '--');
-      this._element.appendChild(desc);
+      this._el.appendChild(desc);
     }
   };
 });
diff --git a/dev/js/src/hint/menu.js b/dev/js/src/hint/menu.js
index bf1a04b..b7e0d49 100644
--- a/dev/js/src/hint/menu.js
+++ b/dev/js/src/hint/menu.js
@@ -29,7 +29,7 @@
 	          lengthFieldClass : lengthFieldClass
 	        });
       obj._context = context;
-      obj._element.classList.add('hint');
+      obj._el.classList.add('hint');
       obj._hint = hint;
 
       // Make the top item always active
diff --git a/dev/js/src/hint/prefix.js b/dev/js/src/hint/prefix.js
index 197e36e..5a83284 100644
--- a/dev/js/src/hint/prefix.js
+++ b/dev/js/src/hint/prefix.js
@@ -15,9 +15,9 @@
      * Override the prefix action.
      */
     onclick : function () {
-      var m = this.menu();
-      var value = this.value();
-      var h = m.hint();
+      const m = this.menu();
+      const value = this.value();
+      const h = m.hint();
       m.hide();
 
       h.inputField().insert(value);
diff --git a/dev/js/src/match.js b/dev/js/src/match.js
index 52dffce..df7db03 100644
--- a/dev/js/src/match.js
+++ b/dev/js/src/match.js
@@ -45,7 +45,7 @@
      */
     _init : function (match) {
       const t= this;
-      t._element = null;
+      t._el = null;
       t._initialized = false;
 
       // No match defined
@@ -57,7 +57,7 @@
 
       // Match defined as a node
       else if (match instanceof Node) {
-        t._element  = match;
+        t._el  = match;
 
         // Circular reference !!
         match["_match"] = t;
@@ -143,7 +143,7 @@
         return t;
 
       // Add actions unless it's already activated
-      const element = t._element;
+      const element = t._el;
 
       // There is an element to open
       if (element === undefined || element === null)
@@ -159,9 +159,9 @@
       // Create panel
       t.panel = matchPanelClass.create(t);
 
-      t._element.insertBefore(
+      t._el.insertBefore(
         t.panel.element(),
-        t._element.querySelector("p.ref")
+        t._el.querySelector("p.ref")
       );
 
       // Insert before reference line
@@ -180,7 +180,7 @@
     open : function () {
       
       // Add actions unless it's already activated
-      const element = this._element;
+      const element = this._el;
 
       // There is an element to open
       if (element === undefined || element === null)
@@ -215,7 +215,7 @@
      * Toggle match view
      */
     toggle : function () {
-      if (this._element.classList.contains('active'))
+      if (this._el.classList.contains('active'))
         this.minimize();
       else
         this.open();
@@ -226,7 +226,7 @@
      * Minimize info view
      */
     minimize : function () {
-      this._element.classList.remove('active');
+      this._el.classList.remove('active');
     },
 
     
@@ -234,7 +234,7 @@
      * Get match element.
      */
     element : function () {
-      return this._element; // May be null
+      return this._el; // May be null
     }
   };
 });
diff --git a/dev/js/src/match/meta.js b/dev/js/src/match/meta.js
index 2df6a58..02dfa53 100644
--- a/dev/js/src/match/meta.js
+++ b/dev/js/src/match/meta.js
@@ -38,8 +38,8 @@
      * Create match reference view.
      */
     element : function () {
-      if (this._element !== undefined)
-        return this._element;
+      if (this._el !== undefined)
+        return this._el;
 
       if (this._fields === null)
         return;
@@ -47,7 +47,7 @@
       const metaDL = document.createElement('dl');
       metaDL.classList.add("flex");
 
-      this._element = metaDL;
+      this._el = metaDL;
 
       const fields = this._fields;
 
@@ -110,9 +110,9 @@
       });
 
       // Add corpusByMatch assistant
-      this._corpusByMatch = cbmClass.create(this._element);
+      this._corpusByMatch = cbmClass.create(this._el);
 
-      return this._element;
+      return this._el;
     }
   };
 });
diff --git a/dev/js/src/match/querycreator.js b/dev/js/src/match/querycreator.js
index b7d54fc..09d91b8 100644
--- a/dev/js/src/match/querycreator.js
+++ b/dev/js/src/match/querycreator.js
@@ -84,7 +84,7 @@
       );
 
       // Initialize element
-      const e = t._element = document.createElement('p');
+      const e = t._el = document.createElement('p');
       e.classList.add('query','fragment');
 
       // Prepend info text
@@ -310,7 +310,7 @@
     
     // Get element representing annotation line
     element : function () {
-      return this._element;
+      return this._el;
     },
 
 
@@ -332,7 +332,7 @@
 
         // Hide element
         if (t._shown === true) {
-          m.parentNode.removeChild(t._element);
+          m.parentNode.removeChild(t._el);
           t._shown = false;
         }
       }
@@ -344,7 +344,7 @@
 
           // Insert after
           m.parentNode.insertBefore(
-            t._element, m.nextSibling
+            t._el, m.nextSibling
           );
           t._shown = true;
         };
diff --git a/dev/js/src/match/table.js b/dev/js/src/match/table.js
index 9481728..d41fc7b 100644
--- a/dev/js/src/match/table.js
+++ b/dev/js/src/match/table.js
@@ -199,15 +199,15 @@
      * Get HTML table view of annotations.
      */
     element : function () {
-      if (this._element !== undefined)
-        return this._element;
+      if (this._el !== undefined)
+        return this._el;
 
       // First the legend table
       const wrap = d.createElement('div');
 
       const table = wrap.addE('table');
 
-      this._element = wrap;
+      this._el = wrap;
 
       // Single row in head
       let tr = table.addE('thead').addE('tr');
@@ -318,9 +318,9 @@
       }, this);
       
       // Add query creator
-      this._matchCreator = matchQueryCreator.create(this._element);
+      this._matchCreator = matchQueryCreator.create(this._el);
       
-      return this._element;
+      return this._el;
     },
   };
 });
diff --git a/dev/js/src/match/treearc.js b/dev/js/src/match/treearc.js
index 117936c..a90fbed 100644
--- a/dev/js/src/match/treearc.js
+++ b/dev/js/src/match/treearc.js
@@ -441,8 +441,8 @@
      * Get the svg element
      */
     element : function () {
-      if (this._element !== undefined)
-        return this._element;
+      if (this._el !== undefined)
+        return this._el;
 
       // Create svg
       const svg = this._c("svg");
@@ -468,8 +468,8 @@
       arrow.setAttribute("d", "M 0,-5 0,5 10,0 Z");
       marker.appendChild(arrow);
 
-      this._element = svg;
-      return this._element;
+      this._el = svg;
+      return this._el;
     },
 
 
@@ -643,12 +643,12 @@
      *   This is identical to treehierarchy
      */
     center : function () {
-      if (this._element === undefined)
+      if (this._el === undefined)
        return;
 
-      const treeDiv = this._element.parentNode;
+      const treeDiv = this._el.parentNode;
 
-      const cWidth = parseFloat(window.getComputedStyle(this._element).width);
+      const cWidth = parseFloat(window.getComputedStyle(this._el).width);
       const treeWidth = parseFloat(window.getComputedStyle(treeDiv).width);
       // Reposition:
       if (cWidth > treeWidth) {
@@ -661,7 +661,7 @@
     // Show the element
     show : function () {
       const t = this;
-      const svg = this._element;
+      const svg = this._el;
       const height = this.maxArc;
 
       // Delete old group
diff --git a/dev/js/src/match/treehierarchy.js b/dev/js/src/match/treehierarchy.js
index 5273089..a52c883 100644
--- a/dev/js/src/match/treehierarchy.js
+++ b/dev/js/src/match/treehierarchy.js
@@ -186,11 +186,11 @@
      *   This is identical to relations
      */
     center : function () {
-      if (this._element === undefined)
+      if (this._el === undefined)
         return;
 
-      const treeDiv = this._element.parentNode;
-      const cWidth = parseFloat(window.getComputedStyle(this._element).width);
+      const treeDiv = this._el.parentNode;
+      const cWidth = parseFloat(window.getComputedStyle(this._el).width);
       const treeWidth = parseFloat(window.getComputedStyle(treeDiv).width);
 
       // Reposition:
@@ -231,14 +231,14 @@
      */
     element : function () {
 
-      if (this._element !== undefined)
-        return this._element;
+      if (this._el !== undefined)
+        return this._el;
 
       const g = this._graph;
       dagre.layout(g);
       
       const canvas = this._c('svg');
-      this._element = canvas;
+      this._el = canvas;
 
       canvas.appendChild(this._c('defs'));
 
@@ -338,7 +338,7 @@
 
       canvas.setAttribute('width', g.graph().width);
       canvas.setAttribute('height', height);
-      return this._element;
+      return this._el;
     },
     
     downloadLink : function () {
diff --git a/dev/js/src/menu.js b/dev/js/src/menu.js
index 9d3c44e..c139ba7 100644
--- a/dev/js/src/menu.js
+++ b/dev/js/src/menu.js
@@ -123,7 +123,7 @@
       );
 
       
-      t._element = el;
+      t._el = el;
 
       t._limit = menuLimit;
       
@@ -261,8 +261,8 @@
       const t = this;
 
       // Remove circular reference to "this" in menu
-      if (t._element != undefined)
-        delete t._element["menu"]; 
+      if (t._el != undefined)
+        delete t._el["menu"]; 
 
       // Remove circular reference to "this" in items
       t._items.forEach(function(i) {
@@ -280,7 +280,7 @@
      * Focus on this menu.
      */
     focus : function () {
-      this._element.focus();
+      this._el.focus();
     },
 
 
@@ -440,7 +440,7 @@
      * Get the associated dom element.
      */
     element : function () {
-      return this._element;
+      return this._el;
     },
 
 
@@ -502,7 +502,7 @@
         t._prefix.active(true);
 
         // finally show the element
-        t._element.classList.add('visible');
+        t._el.classList.add('visible');
         
         return true;
       };
@@ -554,7 +554,7 @@
       t._prefix.active(false);
 
       // finally show the element
-      t._element.classList.add('visible');
+      t._el.classList.add('visible');
 
       // Add classes for rolling menus
       t._boundary(true);
@@ -571,9 +571,9 @@
         this.removeItems();
         this._prefix.clear();
         this.onHide();
-        this._element.classList.remove('visible');
+        this._el.classList.remove('visible');
       }
-      // this._element.blur();
+      // this._el.blur();
     },
 
 
@@ -618,11 +618,11 @@
      */
     removeItems : function () {
       // Remove all children
-      const children = this._element.childNodes;
+      const children = this._el.childNodes;
 
       // Leave the prefix and lengthField
       for (let i = children.length - 1; i >= 3; i--) {
-        this._element.removeChild(
+        this._el.removeChild(
           children[i]
         );
       };
@@ -874,7 +874,7 @@
 
         // Remove the HTML node from the first item
         // leave lengthField/prefix/slider
-        t._element.removeChild(t._element.children[3]);
+        t._el.removeChild(t._el.children[3]);
 
         t._append(
           t._list[t.offset + t.limit() - 1]
@@ -886,7 +886,7 @@
         t.offset = off;
 
         // Remove the HTML node from the last item
-        t._element.removeChild(t._element.lastChild);
+        t._el.removeChild(t._el.lastChild);
 
         t._prepend(t._list[t.offset]);
       }
diff --git a/dev/js/src/menu/item.js b/dev/js/src/menu/item.js
index 7ce7455..e369918 100644
--- a/dev/js/src/menu/item.js
+++ b/dev/js/src/menu/item.js
@@ -105,8 +105,8 @@
    */
   element : function () {
     // already defined
-    if (this._element !== undefined)
-      return this._element;
+    if (this._el !== undefined)
+      return this._el;
     
     // Create list item
     const li = document.createElement("li");
@@ -119,7 +119,7 @@
     // Append template
     li.appendChild(this.content());
     
-    return this._element = li;
+    return this._el = li;
   },
 
   /**
diff --git a/dev/js/src/menu/lengthField.js b/dev/js/src/menu/lengthField.js
index 8a6641d..eed90b7 100644
--- a/dev/js/src/menu/lengthField.js
+++ b/dev/js/src/menu/lengthField.js
@@ -12,8 +12,8 @@
 
   // Initialize lengthField object
   _init : function () {
-    this._element = document.createElement('div');
-    this._element.classList.add('lengthField');
+    this._el = document.createElement('div');
+    this._el.classList.add('lengthField');
     return this;
   },
 
@@ -36,7 +36,7 @@
    * Get the associated dom element.
    */
   element : function () {
-    return this._element;
+    return this._el;
   },
 
 
@@ -44,7 +44,7 @@
    * Add string to lengthField.
    */
   add : function (param) {
-    this._element.appendChild(document.createElement('span'))
+    this._el.appendChild(document.createElement('span'))
       .appendChild(document.createTextNode(param[0] + '--'));
   },
 
@@ -53,8 +53,8 @@
    * Remove all initialized values
    */
   reset : function () {
-    while (this._element.firstChild) {
-      this._element.firstChild.remove();
+    while (this._el.firstChild) {
+      this._el.firstChild.remove();
     };
   }
 });
diff --git a/dev/js/src/menu/prefix.js b/dev/js/src/menu/prefix.js
index e513e85..3930e45 100644
--- a/dev/js/src/menu/prefix.js
+++ b/dev/js/src/menu/prefix.js
@@ -17,19 +17,19 @@
     t._string = '';
 
     // Add prefix span
-    t._element = document.createElement('span');
-    t._element.classList.add('pref');
+    t._el = document.createElement('span');
+    t._el.classList.add('pref');
     // Connect action
 
     if (t["onclick"] !== undefined)
-      t._element["onclick"] = t.onclick.bind(t);
+      t._el["onclick"] = t.onclick.bind(t);
     
     return t;
   },
 
 
   _update : function () {
-    return this._element.innerHTML
+    return this._el.innerHTML
       = this._string;
   },
 
@@ -132,7 +132,7 @@
    * Get the associated dom element.
    */
   element : function () {
-    return this._element;
+    return this._el;
   },
 
 
diff --git a/dev/js/src/menu/slider.js b/dev/js/src/menu/slider.js
index 5897da2..dcc6fc5 100644
--- a/dev/js/src/menu/slider.js
+++ b/dev/js/src/menu/slider.js
@@ -60,12 +60,12 @@
     if (arguments.length === 1) {
       if (bool) {
 	      if (!this._active) {
-	        this._element.classList.add('active');
+	        this._el.classList.add('active');
 	        this._active = true;
 	      };
       }
       else if (this._active) {
-	      this._element.classList.remove('active');
+	      this._el.classList.remove('active');
 	      this._active = false;
       }
     };
@@ -140,7 +140,7 @@
    * Get the associated dom element.
    */
   element : function () {
-    return this._element;
+    return this._el;
   },
 
 
@@ -151,7 +151,7 @@
   reInit : function () {
 
     const t = this;
-    const s = t._element.style;
+    const s = t._el.style;
 
     // Do not show the slider, in case there is nothing to scroll
     if (t._length <= t._limit) {
@@ -179,7 +179,7 @@
     t._event = {};
     t._active = false;
 
-    const el = t._element = document.createElement('div');
+    const el = t._el = document.createElement('div');
     el.setAttribute('class', 'ruler');
 
     t._slider = el.appendChild(
@@ -204,7 +204,7 @@
 
   // Reinit height based on dom position
   _initClientHeight : function () {
-    this._rulerHeight  = this._element.clientHeight;
+    this._rulerHeight  = this._el.clientHeight;
     this._sliderHeight = this._slider.clientHeight;
   },
 
diff --git a/dev/js/src/panel.js b/dev/js/src/panel.js
index 246a861..bfc95c5 100644
--- a/dev/js/src/panel.js
+++ b/dev/js/src/panel.js
@@ -47,8 +47,8 @@
      * The element of the panel
      */
     element : function () {
-      if (this._element)
-        return this._element;
+      if (this._el)
+        return this._el;
 
       // Create panel element
       const e = document.createElement('div');
@@ -66,8 +66,7 @@
       if (!aElem.parentNode)
         e.appendChild(aElem);
 
-      this._element = e;
-      return e;
+      return this._el = e;
     },
 
 
diff --git a/dev/js/src/plugin/server.js b/dev/js/src/plugin/server.js
index 19f8c5f..bc4eaaa 100644
--- a/dev/js/src/plugin/server.js
+++ b/dev/js/src/plugin/server.js
@@ -544,11 +544,11 @@
      * Return the service element.
      */
     element : function () {
-      if (!this._element) {
-        this._element = document.createElement('div');
-        this._element.setAttribute("id", "services");
+      if (!this._el) {
+        this._el = document.createElement('div');
+        this._el.setAttribute("id", "services");
       }
-      return this._element;
+      return this._el;
     },
     
     // Destructor, just for testing scenarios
@@ -565,12 +565,12 @@
         b => buttonsSingle[b] = []
       );
 
-      if (this._element) {
-        let e = this._element;
+      if (this._el) {
+        let e = this._el;
         if (e.parentNode) {
           e.parentNode.removeChild(e);
         };
-        this._element = null;
+        this._el = null;
       };
       
       this._removeListener();
diff --git a/dev/js/src/plugin/widget.js b/dev/js/src/plugin/widget.js
index 5f8ca9a..48cc393 100644
--- a/dev/js/src/plugin/widget.js
+++ b/dev/js/src/plugin/widget.js
@@ -32,8 +32,8 @@
     show : function () {
 
       if (this._load) {
-        if (this._element)
-          this._element.classList.add('show');
+        if (this._el)
+          this._el.classList.add('show');
         return this._load;
       }
 
diff --git a/dev/js/src/tutorial.js b/dev/js/src/tutorial.js
index ee311dd..7963385 100644
--- a/dev/js/src/tutorial.js
+++ b/dev/js/src/tutorial.js
@@ -61,7 +61,7 @@
 	      d.getElementsByTagName('body')[0].appendChild(div);
 
 	      t._iframe = null;
-	      t._element = div;
+	      t._el = div;
 
 	      // Some fields
 	      t._ql     = d.getElementById("ql-field");
@@ -137,7 +137,7 @@
      */
     show : function () {
       const t = this;
-      const element = t._element;
+      const element = t._el;
       if (element.style.display === 'block')
 	      return;
 
@@ -181,7 +181,7 @@
      * Close tutorial window.
      */
     hide : function () {
-      this._element.style.display = 'none';
+      this._el.style.display = 'none';
     },
 
 
diff --git a/dev/js/src/vc.js b/dev/js/src/vc.js
index 7bf0d34..2c068ee 100644
--- a/dev/js/src/vc.js
+++ b/dev/js/src/vc.js
@@ -313,13 +313,13 @@
      */
     element : function() {
       const t = this;
-      let e = t._element;
+      let e = t._el;
 
       if (e !== undefined)
         return e;
 
 
-      e = t._element = document.createElement('div');
+      e = t._el = document.createElement('div');
       e.classList.add('vc');
 
 
@@ -343,7 +343,7 @@
       t.addVcInfPanel();
       
       //Adds EventListener for corpus changes
-      t._element.addEventListener('vcChange', function (e) {
+      t._el.addEventListener('vcChange', function (e) {
         this.checkStatActive(e.detail);
       }.bind(t), false);
       
@@ -355,9 +355,9 @@
      * Check, if the VC is open
      */
     isOpen : function () {
-      if (!this._element)
+      if (!this._el)
         return false;
-      return this._element.classList.contains('active');
+      return this._el.classList.contains('active');
     },
     
 
@@ -506,7 +506,7 @@
     addVcInfPanel : function () {
       // Create panel  
       this.panel = vcPanelClass.create(this); 
-      this._element.addE('div').appendChild(this.panel.element());
+      this._el.addE('div').appendChild(this.panel.element());
       
     },
     
diff --git a/dev/js/src/vc/chooseitem.js b/dev/js/src/vc/chooseitem.js
index 039764c..5032895 100644
--- a/dev/js/src/vc/chooseitem.js
+++ b/dev/js/src/vc/chooseitem.js
@@ -82,8 +82,8 @@
       const t = this;
 
       // already defined
-      if (t._element !== undefined)
-	      return t._element;
+      if (t._el !== undefined)
+	      return t._el;
 
       // Create list item
       const li = document.createElement("li");
@@ -94,7 +94,7 @@
       li["onclick"] = t.onclick.bind(t);
 
       li.addT(t._name);
-      return t._element = li;
+      return t._el = li;
     }
   }
 });
diff --git a/dev/js/src/vc/doc.js b/dev/js/src/vc/doc.js
index fd4c318..37b0e0b 100644
--- a/dev/js/src/vc/doc.js
+++ b/dev/js/src/vc/doc.js
@@ -63,11 +63,11 @@
     update : function () {
       const t = this;
 
-      if (t._element === undefined)
+      if (t._el === undefined)
         return t.element();
       
       // Get element
-      const e = t._element;
+      const e = t._el;
 
       // Check if there is a change in the underlying data
       if (!t.__changed)
@@ -167,13 +167,13 @@
      */
     element : function () {
       const t = this;
-      if (t._element !== undefined)
-        return t._element;
+      if (t._el !== undefined)
+        return t._el;
 
-      t._element = document.createElement('div');
-      t._element.setAttribute('class', 'doc');
+      t._el = document.createElement('div');
+      t._el.setAttribute('class', 'doc');
       t.update();
-      return t._element;
+      return t._el;
     },
 
 
@@ -394,7 +394,7 @@
       const menu = KorAP._vcKeyMenu;
 
       // Insert menu
-      this._element.insertBefore(
+      this._el.insertBefore(
         menu.element(),
         this._keyE
       );
@@ -476,7 +476,7 @@
       };
 
       // Insert menu
-      this._element.insertBefore(
+      this._el.insertBefore(
         menu.element(),
         this._matchopE
       );
@@ -545,12 +545,12 @@
           };
 
           // Remove datepicker
-          that._element.removeChild(
+          that._el.removeChild(
             dp.element()
           );
         });
 
-        this._element.insertBefore(
+        this._el.insertBefore(
           dp.show(), // Get element of the date picker
           this._valueE
         );
@@ -570,14 +570,14 @@
           else
             that.type('string');
           
-          that._element.removeChild(
-            this._element
+          that._el.removeChild(
+            this._el
           );
           that.update();
         };
 
         // Insert element
-        this._element.insertBefore(
+        this._el.insertBefore(
           strElem,
           this._valueE
         );
@@ -616,10 +616,10 @@
 
       delete this["_rewrites"];
       
-      if (this._element === undefined)
+      if (this._el === undefined)
         return;
 
-      this._element.classList.remove("rewritten");
+      this._el.classList.remove("rewritten");
     },
 
 
diff --git a/dev/js/src/vc/docgroup.js b/dev/js/src/vc/docgroup.js
index 1dbd5d7..6ea5e8b 100644
--- a/dev/js/src/vc/docgroup.js
+++ b/dev/js/src/vc/docgroup.js
@@ -196,10 +196,10 @@
 	      };
       };
 
-      if (t._element === undefined)
+      if (t._el === undefined)
 	      return t;
 
-      const group = t._element;
+      const group = t._el;
       group.setAttribute('data-operation', t.operation());
 
       _removeChildren(group);
@@ -231,10 +231,10 @@
     element : function () {
       const t = this;
 
-      if (t._element !== undefined)
-	      return t._element;
+      if (t._el !== undefined)
+	      return t._el;
 
-      const e = t._element = document.createElement('div');
+      const e = t._el = document.createElement('div');
       e.setAttribute('class', 'docGroup');
 
       // Update the object - including optimization
diff --git a/dev/js/src/vc/docgroupref.js b/dev/js/src/vc/docgroupref.js
index 9f1401a..5a9196b 100644
--- a/dev/js/src/vc/docgroupref.js
+++ b/dev/js/src/vc/docgroupref.js
@@ -49,10 +49,10 @@
     update : function () {
       const t = this;
 
-      if (t._element === undefined)
+      if (t._el === undefined)
         return t.element();
 
-      const e = t._element;
+      const e = t._el;
 
       // Check if there is a change in the underlying data
       if (!t.__changed)
@@ -126,10 +126,10 @@
      */
     element : function () {
 
-      if (this._element !== undefined)
-	      return this._element;
+      if (this._el !== undefined)
+	      return this._el;
 
-      const e = this._element = document.createElement('div');
+      const e = this._el = document.createElement('div');
       e.setAttribute('class', 'doc groupref');
       this.update();
       return e;
@@ -158,14 +158,14 @@
       str.store = function (ref, regex) {
         that.ref(ref);
           
-        that._element.removeChild(
-          this._element
+        that._el.removeChild(
+          this._el
         );
         that.update();
       };
 
       // Insert element
-      this._element.insertBefore(
+      this._el.insertBefore(
         strElem,
         this._refE
       );
@@ -256,10 +256,10 @@
 
       delete this["_rewrites"];
 
-      if (this._element === undefined)
+      if (this._el === undefined)
         return;
 
-      this._element.classList.remove("rewritten");
+      this._el.classList.remove("rewritten");
     },
 
 
diff --git a/dev/js/src/vc/fragment.js b/dev/js/src/vc/fragment.js
index 0f155ff..72bd80e 100644
--- a/dev/js/src/vc/fragment.js
+++ b/dev/js/src/vc/fragment.js
@@ -89,12 +89,12 @@
      * Get the element associated with the virtual corpus
      */
     element : function () {
-      if (this._element !== undefined) {
-        return this._element;
+      if (this._el !== undefined) {
+        return this._el;
       };
 
       // Initialize element
-      const e = this._element = document.createElement('div');
+      const e = this._el = document.createElement('div');
       e.classList.add('vc', 'fragment');
 
       // Prepend info text
diff --git a/dev/js/src/vc/item.js b/dev/js/src/vc/item.js
index 59589d8..bf394b8 100644
--- a/dev/js/src/vc/item.js
+++ b/dev/js/src/vc/item.js
@@ -86,8 +86,8 @@
       const t = this;
 
       // already defined
-      if (t._element !== undefined)
-	      return t._element;
+      if (t._el !== undefined)
+	      return t._el;
 
       // Create list item
       var li = document.createElement("li");
@@ -100,7 +100,7 @@
       li["onclick"] = t.onclick.bind(t);
 
       li.addT(t._name);
-      return t._element = li;
+      return t._el = li;
     }
   };
 });
diff --git a/dev/js/src/vc/jsonld.js b/dev/js/src/vc/jsonld.js
index fdee980..06be1e0 100644
--- a/dev/js/src/vc/jsonld.js
+++ b/dev/js/src/vc/jsonld.js
@@ -49,14 +49,14 @@
       const t = this;
       if (t._ops != undefined) {
 	      t._ops._parent = undefined;
-	      if (t._ops._element !== undefined) {
-	        t._ops._element.refTo = undefined;
+	      if (t._ops._el !== undefined) {
+	        t._ops._el.refTo = undefined;
         };
 	      t._ops = undefined;
       };
 
-      if (t._element !== undefined)
-	      t._element = undefined;
+      if (t._el !== undefined)
+	      t._el = undefined;
       
       // In case of a group, destroy all operands
       if (t._operands !== undefined) {
diff --git a/dev/js/src/vc/rewritelist.js b/dev/js/src/vc/rewritelist.js
index 410c975..1d4d881 100644
--- a/dev/js/src/vc/rewritelist.js
+++ b/dev/js/src/vc/rewritelist.js
@@ -36,10 +36,10 @@
      * Get element.
      */
     element : function () {
-      if (this._element !== undefined)
-	      return this._element;
+      if (this._el !== undefined)
+	      return this._el;
 
-      const e = this._element = document.createElement('div');
+      const e = this._el = document.createElement('div');
       e.setAttribute('class', 'rewrite');
 
       const comments = [];
@@ -65,7 +65,7 @@
 
         comments.push(rewriteText + ' (' + rewrite.operation() + ')');
         
-	      this._element.appendChild(span);
+	      this._el.appendChild(span);
       }, this);
 
       e.setAttribute("title", comments.join("\n"))
diff --git a/dev/js/src/vc/statistic.js b/dev/js/src/vc/statistic.js
index 4dd5ab3..0fda3ba 100644
--- a/dev/js/src/vc/statistic.js
+++ b/dev/js/src/vc/statistic.js
@@ -38,9 +38,9 @@
      */
     element : function () {
 
-      // if this._element already exists return without doing something
-      if (this._element !== undefined) {
-        return this._element;
+      // if this._el already exists return without doing something
+      if (this._el !== undefined) {
+        return this._el;
       }
 
       // create HTML Description List Element
@@ -59,8 +59,8 @@
         statDD.addT(new Number(statistic[k]).toLocaleString());
       });
 
-      this._element = statDL;
-      return this._element;
+      this._el = statDL;
+      return this._el;
     }
   }
 
diff --git a/dev/js/src/vc/stringval.js b/dev/js/src/vc/stringval.js
index 0705033..54f92ec 100644
--- a/dev/js/src/vc/stringval.js
+++ b/dev/js/src/vc/stringval.js
@@ -93,12 +93,12 @@
 
   // Update dom element
   _update : function () {
-    if (this._element === undefined)
+    if (this._el === undefined)
       return;
  
     this._value = this._input.value;
 
-    const cl = this._element.classList;
+    const cl = this._el.classList;
 
     if (this._regexOp() && this._regex) {
       cl.add('regex');
@@ -121,7 +121,7 @@
    * Put focus on element
    */
   focus : function () {
-    this._element.children[0].focus();
+    this._el.children[0].focus();
   },
 
 
@@ -129,11 +129,11 @@
    * Get the associated dom element.
    */
   element : function () {
-    if (this._element !== undefined)
-      return this._element;
+    if (this._el !== undefined)
+      return this._el;
 
     // Create element
-    const e = this._element = document.createElement('div');
+    const e = this._el = document.createElement('div');
     e.setAttribute('tabindex', 0);
     e.style.outline = 0;
 
diff --git a/dev/js/src/vc/unspecified.js b/dev/js/src/vc/unspecified.js
index fe089a3..5bda78c 100644
--- a/dev/js/src/vc/unspecified.js
+++ b/dev/js/src/vc/unspecified.js
@@ -78,11 +78,11 @@
     update : function () {
       const t = this;
 
-      if (t._element === undefined)
+      if (t._el === undefined)
 	      return t.element();
 
       // Remove element content
-      _removeChildren(t._element);
+      _removeChildren(t._el);
 
       const ellipsis = document.createElement('span');
       ellipsis.addT(loc.EMPTY);
@@ -90,16 +90,16 @@
       // Click on empty criterion
       ellipsis.addEventListener('click', t.onclick.bind(t));
 
-      t._element.appendChild(ellipsis);
+      t._el.appendChild(ellipsis);
 
       // Set ref - TODO: Cleanup!
-      t._element.refTo = t;
+      t._el.refTo = t;
 
       // Set operators
       if (t._parent !== undefined &&
           t.parent().ldType() !== null) {
 
-	      t._element.appendChild(
+	      t._el.appendChild(
 	        t.operators(
 	          false,
 	          false,
@@ -117,12 +117,12 @@
      */
     element : function () {
       const t = this;
-      if (t._element !== undefined)
-	      return t._element;
-      t._element = document.createElement('div');
-      t._element.setAttribute('class', 'doc unspecified');
+      if (t._el !== undefined)
+	      return t._el;
+      t._el = document.createElement('div');
+      t._el.setAttribute('class', 'doc unspecified');
       t.update();
-      return t._element;
+      return t._el;
     },
 
 
@@ -140,9 +140,9 @@
       const menu = KorAP._vcKeyMenu;
 
       // Add key menu element at the correct position
-      this._element.insertBefore(
+      this._el.insertBefore(
 	      menu.element(),	
-	      this._element.firstChild
+	      this._el.firstChild
       );
 
       const that = this;
diff --git a/dev/js/src/view.js b/dev/js/src/view.js
index 77f8d60..a8a79cb 100644
--- a/dev/js/src/view.js
+++ b/dev/js/src/view.js
@@ -43,9 +43,9 @@
      * Element of the view
      */
     element : function () {
-      if (this._element) {
-        this._element.classList.add('show');
-        return this._element;
+      if (this._el) {
+        this._el.classList.add('show');
+        return this._el;
       };
 
       // Create panel element
@@ -70,7 +70,7 @@
 
       e.appendChild(this.actions.element());
 
-      return this._element = e;
+      return this._el = e;
     },
 
 
@@ -86,8 +86,8 @@
      * Hide the widget if shown.
      */
     minimize : function () {
-      if (this._element) {
-        this._element.classList.remove("show");
+      if (this._el) {
+        this._el.classList.remove("show");
       }
     },
 
