User:Ultimate Dark Carnage/Sandbox5.js

(function(mw, $){   var size = $('.User').size;    if (isNAN(size) || size < 1){       return;       console.log('Code failed!');    }    else {       function action(action_type){          action_type.action;       }

function clearChat{ $('.Chat li.message').remove; }

function addButton(button_name, button_action, button_id){ button_action = action({                        action: button_action          }); var button = document.createElement('a'); button.getAttribute('class', 'wikia-button'); button.getAttribute('id', button_id); button.getAttribute('onclick', button_action); button.innerHTML = button_name; document.getElementsByClassName('Write')[0].appendChild(button); }

addButton("Clear Chat", clearChat, "clear-chat"); } })(this.jQuery, this.mediawiki);