Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
  <table>
    <tr id="sub-155642" style="display: none">
      <td colspan="5">
        <div id="sub-155642" style="display:none;">
            <table width="100%">
                <tr>
                    <td class="inner-table"></td>
                    <td class="inner-table">Document No</td>
                    <td class="inner-table">Document Type</td>
                    <td class="inner-table" id="amount-row">Total Amount</td>
                </tr> 
            </table> 
        </div>  
      </td>
    </tr>
  </table>
  <button onclick="popup()">Pop-up</button>
</body>
</html>
 
var popupEl;
function popup() {
  var divEl, 
      tableEl,
      xEl;
  if(!popupEl) {
    // Find table
    tableEl = document.querySelector('#sub-155642 > table');
    divEl = tableEl.parentNode;
    // Create popup and clone table to it
    popupEl = document.createElement('div');
    popupEl.innerHTML = divEl.innerHTML;
    popupEl.setAttribute('style', 'position:fixed;top:50%;left:50%;width:300px;height:100px;margin-left:-150px;margin-top:-50px;border:1px solid gray');
    // Show popup
    document.querySelector('body').appendChild(popupEl);
  } else {
    document.querySelector('body').removeChild(popupEl);
    popupEl = null;
  }
}
Output 300px

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers