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");
       }
     },
 
