title: Resize a div on border drag and drop without adding extra markup
body: <p>I have an absolute positioned side panel and I need to change its width by dragging this border. Also I need to change cursor on border hover. Is it possible to do this without adding another div for dragging?</p>
  
  <p>Here is the markup:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>#right_panel {
      position: absolute;
      border-left: solid 3px #ccc;
      width: 100px;
      height: 100%;
      right: 0;
      background-color: #f0f0f0;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;body&gt;
      &lt;div id="right_panel"&gt;&lt;/div&gt;
  &lt;/body&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I don't need a full solution. A Yes (with documentation reference)/No answer is enough. I don't need an answer with a helper <code>div</code>. I already have one:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var m_pos;
  function resize(e){
      var parent = resize_el.parentNode;
      var dx = m_pos - e.x;
      m_pos = e.x;
      parent.style.width = (parseInt(getComputedStyle(parent, '').width) + dx) + "px";
  }
  
  var resize_el = document.getElementById("resize");
  resize_el.addEventListener("mousedown", function(e){
      m_pos = e.x;
      document.addEventListener("mousemove", resize, false);
  }, false);
  document.addEventListener("mouseup", function(){
      document.removeEventListener("mousemove", resize, false);
  }, false);</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>#right_panel {
      position: absolute;
      width: 96px;
      padding-left: 4px;
      height: 100%;
      right: 0;
      background-color: #f0f0f0;
  }
  
  #resize {
      background-color: #ccc;
      position: absolute;
      left: 0;
      width: 4px;
      height: 100%;
      cursor: w-resize;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;body&gt;
      &lt;div id="right_panel"&gt;
          &lt;div id="resize"&gt;&lt;/div&gt;
      &lt;/div&gt;
  &lt;/body&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Again, this is the functionality I want, except I want to remove the extra <code>div</code>.</p>