User:BoatsAreRockable/global.js

importScriptPage('PurgeButton/code.js', 'dev'); //create div document.body.onload = addElement;

function add_div { // creates a div element, class and html content var add_div = document.createElement('div'); new_div.className = 'charlietools'; new_div.innerHTML = 'The html text content'; new_div.style.width = "100px"; new_div.style.height = "100px"; new_div.style.background = "red"; new_div.style.color = "white";

// gets the reference tag var existingelement = document.getElementById('WikiHeader');

// add 'add_div' before 'existingelement', inside body document.body.insertBefore(new_div, existingelement; document.body.onload = addElement; }